<!DOCTYPE html>
<html lang='zh-CN'>
<link href="/assets/projects/application-5f0a70e1ce9688abf44238b1eae7c778.css" media="screen" rel="stylesheet" type="text/css" />
<head>
<meta charset='utf-8'>
<meta content='IE=edge' http-equiv='X-UA-Compatible'>
<meta content='码云,代码托管,git,Git@OSC,gitee.com,开源,项目管理,版本控制,开源代码,代码分享,项目协作,开源项目托管,免费代码托管,Git代码托管,Git托管服务' name='Keywords'>
<meta content='码云(gitee.com)是开源中国社区团队推出的基于Git的快速的、免费的、稳定的在线代码托管平台,不限制私有库和公有库数量' name='Description'>
<title>
message.cpp · B16041616/B16041616李浩铭 - 码云 Gitee.com
</title>
<link href="/assets/favicon-950947d692935bf7e0b1629a69cd89ed.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<meta content='gitee.com/B16041616/B16041616LiHaoMing git https://gitee.com/B16041616/B16041616LiHaoMing.git' name='go-import'>
<link href="/assets/application-4242cbbe3b213edca3aee068c3d357d7.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/application-47479d6be234364e19ac8ee10f303aa7.js" type="text/javascript"></script>
<script src="/assets/lib/jquery.timeago.zh-CN-bcd91c2c27a815fa9a395595874b592b.js" type="text/javascript"></script>

<meta content="authenticity_token" name="csrf-param" />
<meta content="ReIQnSR30XO/ib0/vfIxL31i76Xc7P3JBGBokRPYcs4=" name="csrf-token" />
<script type="text/javascript">
//<![CDATA[
window.gon = {};gon.locale="zh-CN";gon.http_clone="https://gitee.com/B16041616/B16041616LiHaoMing.git";gon.user_project="B16041616/B16041616LiHaoMing";gon.message="B16041616";gon.manage_branch="\u7ba1\u7406\u5206\u652f";gon.manage_tag="\u7ba1\u7406\u6807\u7b7e";gon.enterprise_id=0;gon.ref="master";
//]]>
</script>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
<script>
  var title = document.title.replace(/( - Gitee| - 码云)$/, ''),
    imgUrl = '',
    imgUrlEl = document.querySelector('meta[itemprop=image]')
  if (imgUrlEl) {
    imgUrl = imgUrlEl.getAttribute('content')
  } else {
    imgUrl = "https://gitee.com//logo_4wechat.png"
  }
  wx.config({
    debug: false,
    appId: "wxff219d611a159737",
    timestamp: "1514422831",
    nonceStr: "fb818ec545f081b79faed201db5b4e2e",
    signature: "10cabc985c3b519cb082ef6de6d6b69c26c752e1",
    jsApiList: [
      'onMenuShareTimeline',
      'onMenuShareAppMessage'
    ]
  });
  wx.ready(function () {
    wx.onMenuShareTimeline({
      title: title, // 分享标题
      link: "https://gitee.com/B16041616/B16041616LiHaoMing/blob/master/message.cpp", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
      imgUrl: imgUrl // 分享图标
    });
    wx.onMenuShareAppMessage({
      title: title, // 分享标题
      link: "https://gitee.com/B16041616/B16041616LiHaoMing/blob/master/message.cpp", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
      desc: document.querySelector('meta[name=Description]').getAttribute('content'),
      imgUrl: imgUrl // 分享图标
    });
  });
</script>

<script type='text/x-mathjax-config'>
MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [['$','$'], ['\\(','\\)']],
    displayMath: [["$$","$$"],["\\[","\\]"]],
    processEscapes: true,
    skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'body'],
    processClass: "markdown-body"
  }
});
</script>
<script src="https://gitee.com/uploads/resources/MathJax-2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>

<!--[if lt IE 10]>
<script>
    window.location.href = "/incompatible.html";
</script>
<![endif]-->
</head>

<body class='git-project lang-zh-CN'>
<script src="/assets/projects/app-e8e80cfed4f65d217e3fc893175bdc1f.js" type="text/javascript"></script>
<header class='common-header fixed noborder' id='git-header-nav'>
<div class='ui container'>
<div class='ui menu'>
<div class='item gitosc-logo'>
<a href="/"><img class='ui inline image' height='28' src='/logo.svg?20171024' width='95'>
</a></div>
<a href="/explore/recommend" class="item " title="开源项目">开源项目
</a><a href="/gists" class="item " title="代码片段">代码片段
</a><a href="/enterprises" class="item " title="企业版">企业版
<sup class='ui red label'>
特惠
</sup>
</a><div class='dropdown item ui' id='my-gitee-dropdown'>
<a href="/TaoEr233/events">我的码云</a>
<i class='dropdown icon'></i>
<div class='menu'>
<div class='header user-enterprises'>
<a href="/TaoEr233/enterprises" class="pull-right" target="_blank">全部</a>
企业
<span class='count'></span>
</div>
<div class='disabled item tip'>
无企业
</div>
<div class='header user-groups'>
<a href="/TaoEr233/groups" class="pull-right" target="_blank">全部</a>
组织
<span class='count'></span>
</div>
<div class='disabled item tip'>
无组织
</div>
<div class='header user-projects'>
<a href="/TaoEr233/projects" class="pull-right" target="_blank">全部</a>
项目
<span class='count'></span>
</div>
<div class='disabled item tip'>
无项目
</div>
<div class='ui dimmer'>
<div class='ui loader'></div>
</div>
</div>
</div>
<div class='right menu userbar' id='git-nav-user-bar'>
<div class='item'>
<form accept-charset="UTF-8" action="/search" id="projects-search-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<div class='ui mini fluid input'>
<input autocomplete="off" id="search_top-search-input" name="search" placeholder="搜索项目、代码片段..." type="text" />
<input id="group_id" name="group_id" type="hidden" />
<input id="project_id" name="project_id" type="hidden" value="2825930" />
<input id="type" name="type" type="hidden" />
</div>
</form>

<script>
  $('#projects-search').click(function(){
     $('#projects-search-form').submit();
  });
  $('#projects-search-form').submit(function(){
    query_name = $('#search_top-search-input').val();
    search_type = $('#type').val();
    var reg_exp = new RegExp('^\\*+$');
    if (query_name != undefined && $.trim(query_name).length < 1) {
      $('#search_top-search-input').focus();
      Flash.show("搜索关键字不能少于1个", 'error');
      return false;
    } else if (search_type == 'user' && reg_exp.test(query_name.replace(/\s/g, ''))) {
      Flash.show('搜索格式不正确', 'error');
      return false;
    }
  });
  
  // End
</script>

</div>
<div class='item ui dropdown empty' data-count-path='/notifications/unread_count' data-mark-notice-path='/notifications/mark' id='notice-dropdown'>
<a href="/notifications" class="remind-button"><i class='iconfont icon-remind'></i>
<div class='notice-count total'></div>
</a><div class='notice-dropdown-panel menu'>
<div class='notice-dropdown-panel-header'>
<div class='tab active' data-data-path='/notifications/notices?scope=referer' data-html-path='/notifications/referer' data-scope='referer'>
<div class='content'>
@ 我
<div class='notice-count referer'></div>
</div>
</div>
<div class='tab' data-data-path='/notifications/notices?scope=infos' data-html-path='/notifications/infos' data-scope='infos'>
<div class='content'>
通知
<div class='notice-count infos'></div>
</div>
</div>
<div class='tab' data-data-path='/notifications/notices?scope=messages' data-html-path='/notifications/messages' data-scope='messages'>
<div class='content'>
私信
<div class='notice-count messages'></div>
</div>
</div>
</div>
<div class='item notice-dropdown-panel-container'>
<div class='ui dimmer over active'>
<div class='ui loader'></div>
</div>
<div class='notice-list'></div>
<div class='notice-dropdown-panel-blank'>
暂没有新消息
</div>
</div>
<div class='notice-dropdown-panel-footer'>
<div class='action'>
<div class='side left'>
<a href="javascript: void(0);" class="mark-notices">全部标记为已读
</a></div>
<div class='side right'>
<a href="javascript: void(0);" class="load-all" target="_blank">查看全部
</a></div>
</div>
</div>
</div>
</div>

<div class='ui dropdown link item' id='git-nav-create'>
<i class='iconfont icon-add-circle'></i>
<div class='right menu'>
<a href="/projects/new" class="item"><i class='add square icon'></i>
新建项目
</a><a href="/TaoEr233/codes/new" class="item"><i class='code icon'></i>
发布代码片段
</a><a href="/organizations/new" class="item"><i class='group icon'></i>
创建组织
</a><a href="/create_enterprise" class="item"><i class='icon iconfont icon-enterprise'></i>
开通企业版
</a><a href="/projects/oauth_github" class="item"><i class='github icon'></i>
从 GitHub 导入项目
</a><a href="/projects/csdn_code" class="item"><i class='iconfont icon-logo_csdn icon'></i>
CODE 一键迁移
</a></div>
</div>
<div class='ui dropdown item' id='git-nav-user'>
<a href="/TaoEr233/events"><img avatar="TaoEr233" class="ui avatar image TaoEr233-avatar" />
</a><i class='dropdown icon'></i>
<div class='right menu'>
<a href="/TaoEr233/events" class="item"><div class='mayun-icon my-ic-user-home my-ic-user-home-dims'></div>
个人主页
</a><a href="/profile" class="item"><div class='mayun-icon my-ic-edit my-ic-edit-dims'></div>
设置
</a><div class='divider'></div>
<a href="/logout" class="item destroy-user-session" data-method="delete" rel="nofollow"><div class='mayun-icon my-ic-exit my-ic-exit-dims'></div>
退出
</a></div>
</div>
<script>
  $('.destroy-user-session').click(function() {
    $.cookie('access_token', null, { path: '/' });
  })
</script>

</div>
</div>
</div>
</header>
<style>
  .git-annual-report-mark{top:20px;right:-80px;width:200px;height:100px;z-index:99;position:fixed;color:#fff !important;background-color:#FE7300;-webkit-transform:rotate(45deg);transform:rotate(45deg);text-align:center;padding:25px 0 0 0}.git-annual-report-mark .btn-close{font-size:24px}.git-annual-report-mark .btn-close:hover{opacity:.8}.git-annual-report-mark .btn-close:active{opacity:.6}.git-annual-report-mark:hover{background-color:#ff8119}.git-annual-report-mark:active{background-color:#e56700}
</style>
<a href="/2017annual" class="git-annual-report-mark" id="annual-report-mark"><span class='btn-close'>
&times;
</span>
<br>
码云2017
<br>
<strong>
年度报告
</strong>
</a><script>
  (function() {
    $('#annual-report-mark').on('click', '.btn-close', function(e) {
      e.preventDefault();
      $.cookie('hide_annual_report', '1', {
        expires: 31,
        path: '/'
      });
      return $(this).parent().remove();
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var $header, initMyGiteeDropdown;
  
    $header = $('#git-header-nav');
  
    $header.find('.userbar .ui.dropdown').dropdown({
      on: 'hover',
      action: 'nothing',
      onShow: function() {
        return $(this).parent().addClass('active');
      },
      onHide: function() {
        return $(this).parent().removeClass('active');
      }
    });
  
    initMyGiteeDropdown = function() {
      var $dimmer, $dropdown, isLoaded, isLoading, loadData, renderList;
  
      isLoaded = false;
      isLoading = false;
      $dropdown = $('#my-gitee-dropdown');
      $dimmer = $dropdown.find('.ui.dimmer');
      renderList = function(target, data) {
        var $target, count, html, item, name, _i, _ref, _results;
  
        count = data[target + '_count'];
        $target = $dropdown.find('.header.user-' + target);
        if (count < 1) {
          $target.find('a.pull-right').remove();
          return;
        }
        $target.find('.count').text('(' + count + ')');
        $target.next().remove();
        _ref = data[target + '_list'];
        _results = [];
        for (_i = _ref.length - 1; _i >= 0; _i += -1) {
          item = _ref[_i];
          name = htmlSafe(item.name);
          html = ['<a target="_blank" href="', item.url, '" title="', name, '" class="item">', name, '</a>'].join('');
          _results.push($target.after(html));
        }
        return _results;
      };
      loadData = function() {
        if (isLoaded || isLoading) {
          return;
        }
        isLoading = true;
        $dimmer.addClass('active');
        $(this).parent().addClass('active');
        return $.getJSON('/api/v3/internal/my_resources', function(data) {
          $dimmer.removeClass('active');
          renderList('enterprises', data);
          renderList('projects', data);
          renderList('groups', data);
          isLoading = false;
          return isLoaded = true;
        });
      };
      $dropdown.dropdown({
        on: 'hover',
        action: 'nothing',
        onShow: loadData,
        onHide: function() {
          return $(this).parent().removeClass('active');
        }
      });
      return loadData();
    };
  
    initMyGiteeDropdown();
  
    $header.find('.ui.enterprises.dropdown').dropdown({
      on: 'hover',
      action: 'nothing'
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var updateNavbar;
  
    updateNavbar = function() {
      if (window.scrollY > 5) {
        return $('#git-header-nav').addClass('floating');
      } else {
        return $('#git-header-nav').removeClass('floating');
      }
    };
  
    updateNavbar();
  
    $(window).on('scroll', updateNavbar);
  
  }).call(this);
</script>
<script>
  var emailStatus, commentStatus, gotopStatus;
  
  var c_start;
  c_start = document.cookie.indexOf("remote_way=");
  if (c_start == -1) {
    setCookie('remote_way', "http", 360);
  }
  function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires = " + exdate.toGMTString()) + ("; path = /");
  }
</script>

<!--[if lt IE 10]>
<script>
  window.location.href = "/incompatible.html"
</script>
<![endif]-->

<div class='fixed-notice-messages'>
<div class='ui hide green message' id='project-ok-msg'>
私信发送成功
</div>
<div class='ui container'>
<div class='flash-messages' id='messages-container'></div>
</div>
</div>
<script>
  (function() {
    $(function() {
      var $error_box, notify_content, notify_options, setCookie, template;
  
      template = '<div data-notify="container" class="ui {0} message" role="alert">' + '<i data-notify="dismiss" class="close icon"></i>' + '<span data-notify="message">{2}</span>' + '</div>';
      notify_content = null;
      notify_options = {};
      $error_box = $(".flash_error.flash_error_box");
      if (notify_options.type === "error" && $error_box.length > 0 && !$.isEmptyObject(notify_content.message)) {
        $error_box.html(notify_content.message).show();
      } else if (notify_content) {
        notify_options.delay = 3000;
        notify_options.template = template;
        notify_options.offset = {
          x: 10,
          y: 30
        };
        notify_options.element = '#messages-container';
        $.notify(notify_content, notify_options);
      }
      setCookie = function(name, value) {
        $.cookie(name, value, {
          path: '/',
          expires: 365
        });
      };
      return $('#remove-bulletin').on('click', function() {
        setCookie('remove_bulletin', "gitee-maintain-1514185369");
        $('#git-bulletin').hide();
      });
    });
  
  }).call(this);
</script>

<div class='git-project-header'>
<div class='fixed-notice-messages'>
<div class='ui info icon floating message green' id='fetch-ok' style='display: none'>
<div class='content'>
<div class='header status-title'>
<i class='info icon status-icon'></i>
代码拉取完成，系统将自动刷新
</div>
</div>
</div>
</div>
<div class='ui container'>

<div class='git-project-header-details'>
<div class='git-project-header-actions'>
<span class='ui basic buttons'>
<a class='ui button donate' id='project-donate' title='捐赠'>
<i class='iconfont icon-donation'></i>
捐赠
</a>
<a class='ui button social-count' href='/B16041616/B16041616LiHaoMing#project-donate-overview'>0</a>
<div class='ui small modal project-donate-modal'>
<div class='content'>
项目的主人没有开启捐赠功能，快通知他让他开启吧！
<a id='send-message-to-author'>
&ensp;&ensp;
发送私信 &gt;&gt;
</a>
</div>
<div class='actions' id='modal-act'>
<div class='message'>
</div>
<div class='buttons'>
<div class='ui green cancel button'>
关闭
</div>
</div>
</div>
</div>
<div class='ui small modal wepay-qrcode'>
<div class='header'>
扫描微信二维码支付
<span class='wepay-cash'></span>
</div>
<div class='content weqcode-center'>
<img id='wepay-qrcode' src=''>
</div>
<div class='actions'>
<div class='ui negative button'>取消</div>
<div class='ui button positive right'>
支付完成
</div>
</div>
</div>
</span>
<script>
  (function() {
    var $btnSubmit, $dimmer, $fieldManualCash, $modal;
  
    $modal = $('.project-donate-modal');
  
    $dimmer = $modal.find('.dimmer');
  
    $modal.find('.radio.checkbox').checkbox({
      fireOnInit: true
    });
  
    $fieldManualCash = $modal.find('input[name="manual_cash"]').parents('.field');
  
    $modal.find('input[name="ensure_cash"]').on('change', function() {
      var $this;
  
      $this = $(this);
      $this.parents('.card-fields').find('.checked').removeClass('checked');
      $this.parent().addClass('checked');
      if ($this.val() === 'manual') {
        return $fieldManualCash.show();
      } else {
        return $fieldManualCash.hide();
      }
    });
  
    $('#btn-cancel-donate').on('click', function() {
      return $modal.modal('hide');
    });
  
    $btnSubmit = $modal.find('.ui.pay.button').on('click', function() {
      var $msg, $name, $payType, cash, data, msgReg, nameReg, token;
  
      msgReg = /.{4,256}/;
      nameReg = /.{2,36}/;
      $msg = $modal.find('[name="msg"]');
      $name = $modal.find('[name="name"]');
      $payType = $modal.find('input[name="pay_type"]:checked');
      token = $modal.find('meta[name="csrf-token"]').attr('content');
      cash = $modal.find('input[name="ensure_cash"]:checked').val();
      if (cash === 'manual') {
        cash = $('#manual_cash').val();
      }
      if (isNaN(cash) || cash < 1 || cash > 50000) {
        $('#manual_cash').parent().addClass('error');
        return;
      }
      data = {
        msg: $msg.val(),
        name: $name.val(),
        cash: cash,
        authenticity_token: token
      };
      $('#manual_cash').parent().removeClass('error');
      if (!nameReg.test(data.name)) {
        $name.parent().addClass('error');
        return;
      }
      $name.parent().removeClass('error');
      if (!msgReg.test(data.msg)) {
        $msg.parent().addClass('error');
        return;
      }
      $msg.parent().removeClass('error');
      $dimmer.addClass('active');
      $btnSubmit.addClass('disabled').prop('disabled', true);
      if ($payType.val() === 'wepay') {
        $.ajax({
          url: '/B16041616/B16041616LiHaoMing/wepay',
          data: data,
          type: 'POST',
          success: function(data) {
            var base64data, money;
  
            if (data.result === 'fail') {
              alert('无法完成支付！原因：' + data.msg);
              window.location.reload();
              return;
            }
            money = data.money + ' 元';
            base64data = 'data:image/png;base64,' + data.data.base64QRCode;
            $('#wepay-qrcode').attr('src', base64data);
            $('.wepay-cash').text(money);
            $('.ui.modal.wepay-qrcode').modal('show');
            $btnSubmit.removeClass('disabled').prop('disabled', false);
            $dimmer.removeClass('active');
            return $modal.modal('hide');
          },
          error: function(xhr) {
            if (xhr.status === 401) {
              alert('需要先登录账号才能完成支付！');
              window.location.href = '/login';
              return;
            }
            return alert('无法完成支付，请过一段时间后再试！');
          }
        });
      } else {
        $.ajax({
          url: '/B16041616/B16041616LiHaoMing/alipay',
          data: data,
          type: 'POST',
          success: function(data) {
            if (data.result === 'fail') {
              alert('无法完成支付！原因：' + data.msg);
              window.location.reload();
              return;
            }
            document.write(data.data.html);
            $dimmer.removeClass('active');
            return $btnSubmit.removeClass('disabled').prop('disabled', false);
          },
          error: function(xhr) {
            if (xhr.status === 401) {
              alert('需要先登录账号才能完成支付！');
              window.location.href = '/login';
              return;
            }
            return alert('无法完成支付，请过一段时间后再试！');
          }
        });
      }
      return false;
    });
  
  }).call(this);
</script>

<span class='basic buttons ui watch-container watched'>
<a href="/B16041616/B16041616LiHaoMing/unwatch" class="ui button unwatch" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-watch'></i>
Unwatch
</a><a href="/B16041616/B16041616LiHaoMing/watch" class="ui button watch" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-watch'></i>
Watch
</a><a href="/B16041616/B16041616LiHaoMing/watchers" class="ui button social-count" title="4">4
</a></span>
<span class='basic buttons star-container ui'>
<a href="/B16041616/B16041616LiHaoMing/unstar" class="ui button unstar" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-star'></i>
Unstar
</a><a href="/B16041616/B16041616LiHaoMing/star" class="ui button star" data-method="post" data-remote="true" rel="nofollow"><i class='iconfont icon-star'></i>
Star
</a><a href="/B16041616/B16041616LiHaoMing/stargazers" class="ui button social-count" title="0">0
</a></span>
<span class='ui basic buttons fork-container'>
<a href="#" class="ui button fork" id="fork-top-button"><i class='iconfont icon-fork'></i>
Fork
</a><a href="/B16041616/B16041616LiHaoMing/members" class="ui button social-count" title="0">0
</a></span>
</div>
<h2 class='git-project-title'>
<span class="project-title"><i class="iconfont icon-project-public" title="这是一个公开项目"></i> <a href="/B16041616" class="author" title="B16041616">B16041616</a> / <a href="/B16041616/B16041616LiHaoMing" class="repository" style="padding-bottom: 0px" target="" title="B16041616李浩铭">B16041616李浩铭</a></span><span class="project-badges"><a href="/explore/recommend?lang=c-cpp" class="ui small label" id="project-language" target="_blank" title="主要编程语言">C/C++</a></span>
<input id="project_title" name="project_title" type="hidden" value="B16041616/B16041616李浩铭" />
</h2>
</div>
</div>
<div class='row' id='import-result-message' style='padding-top: 0px; display: none'>
<div class='sixteen wide column'>
<div class='ui icon yellow message status-color'>
<i class='info icon status-icon' style='width:60px;padding-right:12px;'></i>
<i class='close icon'></i>
<div class='header status-title'>
同步状态
</div>
<span class='status-message'></span>
</div>
</div>
</div>
<div class='ui small modal' id='modal-fork-project'>
<div class='close-button'>
<i class='icon-close iconfont'></i>
</div>
<div class='header left aligned'>
Fork 项目
</div>
<div class='content'>
<div class='fork-info-content'>
<div class='ui segment fork_project_loader'>
<div class='ui active inverted dimmer'>
<div class='ui text loader'>加载中</div>
</div>
</div>
</div>
</div>
<div class='actions fork-action hide'>
<a class='cancel'>&emsp;取消&emsp;</a>
<div class='ui large button orange ok'>&emsp;确认&emsp;</div>
</div>
</div>
<script>
  (function() {
    var $modalFork;
  
    this.title_project_path = 'B16041616LiHaoMing';
  
    this.title_fork_url = '/B16041616/B16041616LiHaoMing/sync_fork';
  
    $modalFork = $('#modal-fork-project');
  
    $('#fork-top-button').on('click', function(e) {
      e.preventDefault();
      $modalFork.modal('show');
      return setTimeout(function() {
        return $.ajax({
          url: "/B16041616/B16041616LiHaoMing/fork_project_info"
        });
      }, 500);
    });
  
    $('#modal-fork-project .close-button').on('click', function(e) {
      return $modalFork.modal('hide');
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var $modalDonate;
  
    $('#modal-fork-project').modal({
      transition: 'fade'
    });
  
    $modalDonate = $('.project-donate-modal').modal({
      onApprove: function() {
        return false;
      }
    });
  
    if ("" === 'true') {
      $modalDonate.modal('show');
    }
  
    $('#project-donate').on('click', function() {
      return $modalDonate.modal('show');
    });
  
    $('#send-message-to-author').on('click', function() {
      $modalDonate.modal('hide');
      return $('#project-user-message').trigger('click');
    });
  
  }).call(this);
</script>
<style>
  i.loading {
    -webkit-animation: icon-loading 1.2s linear infinite;
    animation: icon-loading 1.2s linear infinite;
  }
  .qrcode_cs{
    float: left;
  }
</style>

<div class='git-project-nav'>
<div class='ui container'>
<div class='ui secondary pointing menu'>
<a href="/B16041616/B16041616LiHaoMing" class="item active"><i class='iconfont icon-code'></i>
代码
</a><a href="/B16041616/B16041616LiHaoMing/issues" class="item "><i class='iconfont icon-issue'></i>
Issues
<span class='ui mini circular label'>
0
</span>
</a><a href="/B16041616/B16041616LiHaoMing/pulls" class="item "><i class='iconfont icon-pull-request'></i>
Pull Requests
<span class='ui mini circular label'>
0
</span>
</a><a href="/B16041616/B16041616LiHaoMing/attach_files" class="item "><i class='iconfont icon-annex'></i>
附件
<span class='ui mini circular label'>0</span>
</a><a href="/B16041616/B16041616LiHaoMing/wikis" class="item "><i class='iconfont icon-wiki'></i>
Wiki
<span class='ui mini circular label'>
0
</span>
</a><a href="/B16041616/B16041616LiHaoMing/repository/stats/master" class="item "><i class='iconfont icon-statistics'></i>
统计
</a><div class='item'>
<div class='ui dropdown git-project-service'>
<div class='text'>
<i class='iconfont icon-service'></i>
服务
</div>
<i class='dropdown icon'></i>
<div class='menu'>
<a href="/B16041616/B16041616LiHaoMing/paas/select_platform" class="item">代码演示
</a><a href="/B16041616/B16041616LiHaoMing/quality_analyses/confirm_platform" class="item">质量分析
</a><a href="/B16041616/B16041616LiHaoMing/pages" class="item">Pages
</a></div>
</div>
</div>
</div>
</div>
</div>
<script>
  $('.git-project-nav .ui.dropdown').dropdown({ action: 'nothing' });
</script>
<style>
  .git-project-nav i.checkmark.icon {
    color: green;
  }
</style>
<script>
  $('#git-versions.dropdown').dropdown();
  $.ajax({
    url:"/B16041616/B16041616LiHaoMing/access/add_access_log",
    type:"GET"
  });
</script>

</div>
<div class='git-project-content-wrapper'>
<div class='ui container'>
<div class='git-project-content' id='git-project-content'>
<div class='row' id='git-detail-clone'>
<div class='git-project-desc-wrapper'>
<div class='git-project-desc'>
<span class='git-project-desc-text'>
<i>暂无描述</i>
</span>
<span class='git-project-homepage'>
</span>
</div>
<div class='ui form' id='description-edit' style='display:none;'>
<div class='fields'>
<div class='eight wide field'>
<div class='ui small input'>
<input id='desc-input' placeholder='描述' type='text' value=''>
</div>
</div>
<div class='four wide field'>
<div class='ui small input'>
<input id='url-input' placeholder='项目主页(eg: https://gitee.com)' type='text' value=''>
</div>
</div>
<button class='ui positive button' id='btn-save-desc'>
保存更改
</button>
<button class='ui button' id='btn-cancel-edit-desc'>
取消
</button>
</div>
</div>
</div>
<script>
  (function() {
    var $btnCancel, $btnSave, $description, $homepage, $textDescription, $textHomepage, description, homepage;
  
    $homepage = $('#url-input');
  
    $description = $('#desc-input');
  
    homepage = $('#url-input').val();
  
    description = $('#desc-input').val();
  
    $textHomepage = $('.git-project-homepage');
  
    $textDescription = $('.git-project-desc-text');
  
    $btnSave = $('#btn-save-desc');
  
    $btnCancel = $('#btn-cancel-edit-desc');
  
    $btnCancel.on('click', function() {
      $('#description-edit').hide();
      return $('.git-project-desc').show();
    });
  
    $('#btn-edit-desc').on('click', function() {
      $homepage.val(homepage);
      $description.val(description).focus();
      $('#description-edit').show();
      return $('.git-project-desc').hide();
    });
  
    $btnSave.on('click', function() {
      var newDescription, newHomepage, reg, url;
  
      reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)/;
      url = '/B16041616/B16041616LiHaoMing/update_description';
      newDescription = $('#desc-input').val().trim();
      newHomepage = $('#url-input').val().trim();
      if (newHomepage && !reg.test(newHomepage)) {
        newHomepage = 'http://' + newHomepage;
      }
      $btnSave.addClass('disabled').prop('disabled', true);
      $btnCancel.addClass('disabled').prop('disabled', true);
      return $.post(url, {
        desc: newDescription,
        homepage: newHomepage
      }, function(data) {
        $btnSave.removeClass('disabled').prop('disabled', false);
        $btnCancel.removeClass('disabled').prop('disabled', false);
        if (data.status === -1) {
          alert('无权限操作!');
        } else if (data.status === 1) {
          description = newDescription;
          homepage = newHomepage;
          if (description) {
            $textDescription.text(description);
          } else {
            $textDescription.html('<i class="none">暂无描述</i>');
          }
          if (homepage) {
            $textHomepage.html('<a href="' + homepage + '" rel="nofollow">' + homepage + '</a>').show();
          } else {
            $textHomepage.hide();
          }
        } else if (data.status === 0) {
          alert('修改发生错误,请稍后重试!');
          return;
        } else {
          alert(data.status);
          return;
        }
        $('#description-edit').hide();
        return $('.git-project-desc').show();
      });
    });
  
  }).call(this);
</script>

</div>
<div class='ui horizontal hollow nopadding segments git-project-stats'>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/commits/master"><i class='iconfont icon-commit'></i>
<b id='commits_count'>11</b>
次提交
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/branches"><i class='iconfont icon-branches'></i>
<b id='branches_count'>1</b>
个分支
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/tags"><i class='iconfont icon-tag'></i>
<b id='tags_count'>0</b>
个标签
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/releases"><i class='iconfont icon-release'></i>
<b id='releases_count'>0</b>
个发行版
</a></div>
<div class='ui segment center aligned'>
<a href="/B16041616/B16041616LiHaoMing/contributors?ref=master"><i class='iconfont icon-collaborators'></i>
<b id='collaborators_count'></b>
<span class='contributor_text'>
正在获取贡献者
</span>
</a></div>
</div>
<div class='git-project-bread' id='git-project-bread'>
<div class='ui right floated horizontal list'>
<div class='item'>
<div class='ui orange button' id='btn-dl-or-clone'>
克隆/下载
<i class='dropdown icon'></i>
</div>
</div>
</div>
<div class='ui horizontal list'>
<div class='item item git-project-branch-item'>
<input id="path" name="path" type="hidden" value="message.cpp" />
<div class='ui top left pointing dropdown gradient button' id='git-project-branch'>
<input id="ref" name="ref" type="hidden" value="master" />
<div class='default text'>
master
</div>
<i class='dropdown icon'></i>
<div class='menu'>
<div class='ui left icon search input'>
<i class='iconfont icon-search'></i>
<input placeholder='搜索分支或标签' type='text'>
</div>
<div class='header'><div class='pull-right'>
<a href="/B16041616/B16041616LiHaoMing/branches/recent">管理</a></div>分支 (1)</div>
<div class='scrolling menu'>
<div class='item' data-value='master'>master</div>
</div>
</div>
</div>
</div>
<div class='item'>
<div class='repo-index repo-none-index' style='margin-left:0px;'>
<div class='ui horizontal list repo-action-list'>
<div class='item'>
<a href="/B16041616/B16041616LiHaoMing/issues/new" class="ui gradient button repo-action">+ Issue</a>
</div>
<div class='item'>
<div class='ui pointing right top dropdown gradient button' id='git-project-file'>
<div class='text'>文件</div>
<i class='dropdown icon'></i>
<div class='menu'>
<div class='disabled item'>新建文件</div>
<div class='disabled item'>上传文件</div>
<a class='item repo-action' id='search-files'>
搜索文件
</a>
</div>
</div>
</div>
<div class='item'>
<a href="/B16041616/B16041616LiHaoMing/widget" class="ui gradient button repo-action">挂件
</a></div>
</div>
</div>
</div>
<div class='breadcrumb_path item' style='margin-left: 0; padding-left: 0'>
<div class='ui breadcrumb path' id='path-breadcrumb'>
<a href="/B16041616/B16041616LiHaoMing/tree/master" class="section repo-name" data-direction="back" style="font-weight: bold">B16041616LiHaoMing
</a><div class='divider'>
/
</div>
<strong>
message.cpp
</strong>
</div>

</div>
</div>
<div class='ui popup bottom right transition hidden git-project-download-panel'>
<div class='ui small secondary pointing menu'>
<a class='item active' data-type='http' data-url='https://gitee.com/B16041616/B16041616LiHaoMing.git'>HTTPS</a>
<a class='item' data-type='ssh' data-url='git@gitee.com:B16041616/B16041616LiHaoMing.git'>SSH</a>
</div>
<div class='ui fluid right labeled small input'>
<input id="project_clone_url" name="project_clone_url" onclick="focus();select()" readonly="readonly" type="text" value="https://gitee.com/B16041616/B16041616LiHaoMing.git" />
<div class='ui basic label'>
<div class='ui small basic orange button' data-clipboard-target='#project_clone_url' id='btn-copy-clone-url'>
复制
</div>
</div>
</div>
<hr>
<a href="/B16041616/B16041616LiHaoMing/repository/archive/master.zip" class="ui fluid tiny download link button"><i class='icon download'></i>
下载ZIP
</a><hr>
<a href='/enterprises?from=gitosc-project-ad'>
<div class='ent-poster project ver-3'>
<div class='carousel slide' data-interval='5000' data-ride='carousel'>
<div class='carousel-inner'>
<div class='item img-1 active'></div>
<div class='item img-2'></div>
<div class='item img-3'></div>
</div>
</div>
</div>
</a>
</div>
</div>
<style>
  .ui.dropdown .menu>.header{text-transform:none}
</style>
<script>
  $(document).ready(function () {
    var $contri_count = $('#collaborators_count')
    var $contri_text = $('.contributor_text')
    $.ajax({
      url: '/B16041616/B16041616LiHaoMing/contributors_count?ref=master',
      method: 'GET',
      success: function(data) {
        if (data.status === 1) {
          $contri_count.text(data.contributors_count);
          $contri_text.text('位贡献者')
        } else {
          $contri_text.text('获取失败')
        }
      }
    });
    var $tip = $('#apk-download-tip');
    if (!$tip.length) {
      return;
    }
    $tip.find('.btn-close').on('click', function () {
      $tip.slideUp();
    });
  });
  $('#git-project-branch').dropdown({
    fullTextSearch: true,
    onChange: function (value, text) {
      var path = $('#path').val();
      var href = ['/B16041616/B16041616LiHaoMing/tree', value, path].join('/');
      window.location.href = href;
    }
  });
  $('#git-project-file').dropdown({ action: 'hide' });
  (function(){
    function pathAutoRender() {
      var $parent = $('#git-project-bread'),
          $child = $('#git-project-bread').children('.ui.horizontal.list'),
          mainWidth = 0;
      $child.each(function (i,item) {
        mainWidth += $(item).width()
        });
      $('.breadcrumb.path.fork-path').remove();
      if (mainWidth > 995) {
        $('#path-breadcrumb').hide();
        $parent.append('<div class="ui breadcrumb path fork-path">' + $('#path-breadcrumb').html() + '<div/>')
      } else {
        $('#path-breadcrumb').show();
      }
    }
    window.pathAutoRender = pathAutoRender;
    pathAutoRender();
  })();
</script>
<script>
  (function() {
    var $btnCopy, $input, $item, $panel, clipboard, remoteWay;
  
    $input = $('#project_clone_url');
  
    remoteWay = 'http';
  
    clipboard = new Clipboard('#btn-copy-clone-url');
  
    $panel = $('.git-project-download-panel');
  
    $btnCopy = $('#btn-copy-clone-url');
  
    $panel.find('.menu > .item').on('click', function() {
      var $item;
  
      $item = $(this).addClass('active');
      $item.siblings().removeClass('active');
      $input.val($item.attr('data-url'));
      return setCookie('remote_way', $item.attr('data-type'), 360);
    });
  
    $('#btn-dl-or-clone').popup({
      popup: $panel,
      position: 'bottom right',
      on: 'click'
    });
  
    if (remoteWay) {
      $item = $panel.find('.item[data-type="' + remoteWay + '"]');
      if ($item.length === 0) {
        $item = $panel.find('.item[data-type="http"]');
      }
      $item.addClass('active').siblings().removeClass('active');
      $input.val($item.attr('data-url'));
    }
  
    clipboard.on('success', function() {
      $btnCopy.popup({
        content: '已复制',
        position: 'right center',
        onHidden: function() {
          return $btnCopy.popup('destroy');
        }
      });
      return $btnCopy.popup('show');
    });
  
    clipboard.on('error', function() {
      $btnCopy.popup({
        content: '复制失败，请手动复制',
        position: 'right center',
        onHidden: function() {
          return $btnCopy.popup('destroy');
        }
      });
      return $btnCopy.popup('show');
    });
  
  }).call(this);
</script>

<div class='row column tree-holder' id='tree-holder'>
<div class='tree-content-holder' id='tree-content-holder'>
<div class='file_holder'>
<div class='file_title'>
<div class='options'><div class='ui mini buttons basic'>
<textarea id="blob_raw" name="blob_raw" style="display:none;">
﻿// message.cpp: 定义控制台应用程序的入口点。&#x000A;//&#x000A;&#x000A;#include &quot;stdafx.h&quot;&#x000A;#include&lt;Windows.h&gt;&#x000A;&#x000A;&#x000A;int RandomInt(int _min, int _max);       //获取一个随机int&#x000A;int CheckValide(int curPosX, int curPosY, BOOL bCurTeris[4][4]);   //给定一个矩阵，查看是否合法&#x000A;int selectDiffculty(HWND hWnd, int dif);&#x000A;int selectLayOut(HWND hWnd, int layout);&#x000A;&#x000A;//常量声明&#x000A;const int BORDER_X = 10;&#x000A;const int BORDER_Y = 10;&#x000A;const int SCREEN_LEFT_X = 300 + BORDER_X;&#x000A;const int SCREEN_Y = 600 + BORDER_Y;&#x000A;const int SCREEN_RIGHT_X = 180 + BORDER_X * 2;&#x000A;const int SCREEN_X = SCREEN_LEFT_X + SCREEN_RIGHT_X;&#x000A;const BOOL state_teris[][4][4] =&#x000A;{&#x000A;	{ { 1,1,1,1 },{ 0,0,0,0 },{ 0,0,0,0 },{ 0,0,0,0 } },&#x000A;	{ { 0,1,1,0 },{ 0,1,1,0 },{ 0,0,0,0 },{ 0,0,0,0 } },&#x000A;	{ { 0,1,1,1 },{ 0,0,0,1 },{ 0,0,0,0 },{ 0,0,0,0 } },&#x000A;	{ { 0,1,1,0 },{ 0,0,1,1 },{ 0,0,0,0 },{ 0,0,0,0 } },&#x000A;	{ { 0,1,0,0 },{ 1,1,1,0 },{ 0,0,0,0 },{ 0,0,0,0 } },&#x000A;	{ { 0,1,1,1 },{ 0,1,0,0 },{ 0,0,0,0 },{ 0,0,0,0 } },&#x000A;	{ { 0,1,1,0 },{ 1,1,0,0 },{ 0,0,0,0 },{ 0,0,0,0 } }&#x000A;};&#x000A;&#x000A;#define IDS_APP_TITLE			103&#x000A;&#x000A;#define IDR_MAINFRAME			128&#x000A;#define IDD_TETRIS_DIALOG	102&#x000A;#define IDD_ABOUTBOX			103&#x000A;#define IDM_ABOUT				104&#x000A;#define IDM_EXIT				105&#x000A;#define IDM_START 116&#x000A;#define IDM_END 117&#x000A;#define IDM_DIFF 106&#x000A;#define ID_dif1 111&#x000A;#define ID_dif2 112&#x000A;#define ID_dif3 113&#x000A;#define ID_LAYOUT1 114&#x000A;#define ID_LAYOUT2 115&#x000A;#define IDI_TETRIS			107&#x000A;#define IDI_SMALL				108&#x000A;#define IDC_TETRIS			109&#x000A;#define IDC_MYICON				2&#x000A;#ifndef IDC_STATIC&#x000A;#define IDC_STATIC				-1&#x000A;#endif&#x000A;&#x000A;#define MAX_LOADSTRING 100 &#x000A;// 此代码模块中包含的函数的前向声明: &#x000A;ATOM                MyRegisterClass(HINSTANCE hInstance);//窗口注册函数&#x000A;BOOL                InitInstance(HINSTANCE, int);//在启动时初始化应用程序&#x000A;LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);//窗口过程处理函数&#x000A;INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);&#x000A;&#x000A;// 全局变量: &#x000A;HINSTANCE hInst;                               // 当前实例&#x000A;WCHAR szTitle[MAX_LOADSTRING];                  // 标题栏文本&#x000A;WCHAR szWindowClass[MAX_LOADSTRING];            // 主窗口类名&#x000A;HMENU diff;//难度菜单句柄的定义&#x000A;HMENU lay;//布局菜单句柄的定义&#x000A;HMENU start;&#x000A;HMENU end;&#x000A;&#x000A;bool g_hasBlocked[50][50];&#x000A;RECT rc_left, rc_right, rc_right_top, rc_right_bottom, rc_main;&#x000A;int g_speed = 300;&#x000A;int t_speed = 300;&#x000A;BOOL bCurTeris[4][4];&#x000A;BOOL bNextCurTeris[4][4];&#x000A;int curPosX, curPosY;&#x000A;int rd_seed = 1995421;&#x000A;int tPre = 0, tCur;&#x000A;int GAME_STATE = 0;&#x000A;int GAME_SCORE = 0;&#x000A;int GAME_DIFF = 1;&#x000A;int NUM_X = 10;&#x000A;int NUM_Y = 20;&#x000A;int BLOCK_SIZE = 30;&#x000A;&#x000A;void setRandomT();&#x000A;void init_game()&#x000A;{&#x000A;	GAME_SCORE = 0;&#x000A;	setRandomT();//随机生成一个方块用作下一次掉落&#x000A;	curPosX = (NUM_X - 4) &gt;&gt; 1;//设置初始坐标&#x000A;	curPosY = 0;&#x000A;	//memset，是计算机语言中的函数。起功能是将s所指向的某一块内存中的每个字节的内容全部设置为ch指定的ASCII值，最后行清零&#x000A;	memset(g_hasBlocked, 0, sizeof(g_hasBlocked));&#x000A;	rc_left.left = 0;&#x000A;	rc_left.right = SCREEN_LEFT_X;&#x000A;	rc_left.top = 0;&#x000A;	rc_left.bottom = SCREEN_Y;&#x000A;&#x000A;	rc_right.left = rc_left.right + BORDER_X;&#x000A;	rc_right.right = 180 + rc_right.left;&#x000A;	rc_right.top = 0;&#x000A;	rc_right.bottom = SCREEN_Y;&#x000A;&#x000A;	rc_main.left = 0;&#x000A;	rc_main.right = SCREEN_X;&#x000A;	rc_main.top = 0;&#x000A;	rc_main.bottom = SCREEN_Y;&#x000A;&#x000A;	rc_right_top.left = rc_right.left;&#x000A;	rc_right_top.top = rc_right.top;&#x000A;	rc_right_top.right = rc_right.right;&#x000A;	rc_right_top.bottom = (rc_right.bottom) / 2;&#x000A;&#x000A;	rc_right_bottom.left = rc_right.left;&#x000A;	rc_right_bottom.top = rc_right_top.bottom + BORDER_Y;&#x000A;	rc_right_bottom.right = rc_right.right;&#x000A;	rc_right_bottom.bottom = rc_right.bottom;&#x000A;&#x000A;	g_speed = t_speed = 1000 - GAME_DIFF * 280;&#x000A;}&#x000A;&#x000A;void fillBlock()//到达底部后填充矩阵&#x000A;{&#x000A;	int i, j;&#x000A;	for (i = 0; i&lt;4; i++)&#x000A;	{&#x000A;		for (j = 0; j&lt;4; j++)&#x000A;		{&#x000A;			if (bCurTeris[i][j])&#x000A;			{&#x000A;				g_hasBlocked[curPosY + i][curPosX + j] = 1;&#x000A;			}&#x000A;		}&#x000A;	}&#x000A;}&#x000A;&#x000A;void setRandomT()&#x000A;{&#x000A;	int rd_start = RandomInt(0, sizeof(state_teris) / sizeof(state_teris[0]));&#x000A;	int rd_next = RandomInt(0, sizeof(state_teris) / sizeof(state_teris[0]));&#x000A;	//outPutBoxInt(rd_start);&#x000A;	//outPutBoxInt(rd_next);&#x000A;	//outPutBoxInt(rd_start);&#x000A;	if (GAME_STATE == 0)&#x000A;	{&#x000A;		GAME_STATE = GAME_STATE | 0x0001;&#x000A;		//outPutBoxInt(GAME_STATE);&#x000A;		memcpy(bCurTeris, state_teris[rd_start], sizeof(state_teris[rd_start]));&#x000A;		memcpy(bNextCurTeris, state_teris[rd_next], sizeof(state_teris[rd_next]));&#x000A;	}&#x000A;	else&#x000A;	{&#x000A;		memcpy(bCurTeris, bNextCurTeris, sizeof(bNextCurTeris));&#x000A;		memcpy(bNextCurTeris, state_teris[rd_next], sizeof(state_teris[rd_next]));&#x000A;	}&#x000A;&#x000A;}&#x000A;void drawCompleteParticle(int line)&#x000A;{&#x000A;	HWND hWnd = GetActiveWindow();&#x000A;	HDC hdc = GetDC(hWnd);&#x000A;	HBRUSH hBrush = (HBRUSH)GetStockObject(GRAY_BRUSH);&#x000A;	HPEN hPen = (HPEN)CreatePen(PS_DOT, 1, RGB(255, 255, 0));&#x000A;	SelectObject(hdc, hBrush);&#x000A;	SelectObject(hdc, hPen);&#x000A;	Rectangle(hdc, BORDER_X,&#x000A;		BORDER_Y + line*BLOCK_SIZE,&#x000A;		BORDER_X + NUM_X*BLOCK_SIZE,&#x000A;		BORDER_Y + BLOCK_SIZE*(1 + line));&#x000A;	DeleteObject(hBrush);&#x000A;	DeleteObject(hPen);&#x000A;}&#x000A;&#x000A;void checkComplite()//查看一行是否能消去&#x000A;{&#x000A;	int i, j, k, count = 0;&#x000A;	for (i = 0; i&lt;NUM_Y; i++)&#x000A;	{&#x000A;		bool flag = true;&#x000A;		for (j = 0; j&lt;NUM_X; j++)&#x000A;		{&#x000A;			if (!g_hasBlocked[i][j])&#x000A;			{&#x000A;				flag = false;//有一个为空时，不能消去&#x000A;			}&#x000A;		}&#x000A;		if (flag)&#x000A;		{&#x000A;			count++;&#x000A;			for (j = i; j &gt;= 1; j--)//从上往下把每行下移&#x000A;			{&#x000A;				for (k = 0; k&lt;NUM_X; k++)&#x000A;				{&#x000A;					g_hasBlocked[j][k] = g_hasBlocked[j - 1][k];&#x000A;				}&#x000A;&#x000A;			}&#x000A;			drawCompleteParticle(i);//在消去的那行画一行空白做出消去的效果&#x000A;			Sleep(300);//暂停300ms&#x000A;&#x000A;			PlaySound(_T(&quot;coin.wav&quot;), NULL, SND_FILENAME | SND_ASYNC);//消去一行时播放系统自带提示音&#x000A;		}&#x000A;	}&#x000A;	GAME_SCORE += int(count*1.5);//单行+1分，两行+3分，三行+4分，四行6分，以此类推&#x000A;}&#x000A;&#x000A;int APIENTRY wWinMain(HINSTANCE hInstance,//应用程序当前实例句柄&#x000A;	HINSTANCE hPrevInstance,//应用程序其他实例句柄&#x000A;	LPWSTR    lpCmdLine,//指向程序命令行参数的指针&#x000A;	int       nCmdShow)//应用程序开始执行时窗口显示方式的整数值标识&#x000A;{&#x000A;	init_game();//初始化游戏&#x000A;	UNREFERENCED_PARAMETER(hPrevInstance);//展开传递的参数或表达式&#x000A;	UNREFERENCED_PARAMETER(lpCmdLine);//避免编译器关于未引用参数的警告&#x000A;&#x000A;									  // TODO: 在此放置代码。&#x000A;&#x000A;									  // 初始化全局字符串&#x000A;	LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);&#x000A;	LoadStringW(hInstance, IDC_TETRIS, szWindowClass, MAX_LOADSTRING);&#x000A;	MyRegisterClass(hInstance);//注册窗口类，用于兼容&#x000A;&#x000A;							   // 执行应用程序初始化: &#x000A;	if (!InitInstance(hInstance, nCmdShow))&#x000A;	{&#x000A;		return FALSE;&#x000A;	}&#x000A;&#x000A;	HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TETRIS));//加载加速器&#x000A;&#x000A;	MSG msg;&#x000A;&#x000A;	// 主消息循环: &#x000A;	while (1)&#x000A;	{&#x000A;		if (PeekMessage(&amp;msg, 0, 0, 0, PM_REMOVE))//消息检查线程消息队列&#x000A;		{&#x000A;			TranslateMessage(&amp;msg);//将消息的虚拟键转化字符消息&#x000A;			DispatchMessage(&amp;msg);//将消息传送到指定窗口函数&#x000A;			if (msg.message == WM_QUIT)//若消息是退出，则终止&#x000A;			{&#x000A;				break;&#x000A;			}&#x000A;		}&#x000A;		else&#x000A;		{&#x000A;			if ((GAME_STATE &amp; 2) != 0)&#x000A;			{&#x000A;				tCur = GetTickCount();//返回（retrieve）从操作系统启动所经过（elapsed）的毫秒数&#x000A;				if (tCur - tPre&gt;g_speed)//超过反应时间时&#x000A;				{&#x000A;					int flag = CheckValide(curPosX, curPosY + 1, bCurTeris);//判断下一行的情况，返回给flag&#x000A;					if (flag == 1)//正常下降一行&#x000A;					{&#x000A;						curPosY++;//方块坐标y加1&#x000A;						tPre = tCur;//重新计算反应时间&#x000A;						HWND hWnd = GetActiveWindow();&#x000A;						//这里两次调用实现了双缓冲的作用，改善了视觉效果&#x000A;						InvalidateRect(hWnd, &amp;rc_left, FALSE);//向指定的窗体更新区域添加一个矩形，然后窗口客户区域的这一部分将被重新绘制&#x000A;						InvalidateRect(hWnd, &amp;rc_right_top, FALSE);//系统不会像窗口发送WM_PAINT消息，来重绘&#x000A;					}&#x000A;					else if (flag == -2)//方块到底时&#x000A;					{&#x000A;						g_speed = t_speed;//重置速度&#x000A;						fillBlock();//将方块填充给矩形&#x000A;						checkComplite(); //查看能否消去这行&#x000A;						setRandomT();//随机产生新的方块&#x000A;						curPosX = (NUM_X - 4) &gt;&gt; 1;//重新设置方块的坐标x&#x000A;						curPosY = 0;//重新设置方块的坐标y&#x000A;						HWND hWnd = GetActiveWindow();//获得与调用线程的消息队列相关的活动窗口的窗口句柄&#x000A;						InvalidateRect(hWnd, &amp;rc_main, FALSE);//刷新矩形区域&#x000A;					}&#x000A;					else if (flag == -3)//放不下下一个方块（游戏输了）时&#x000A;					{&#x000A;						HWND hWnd = GetActiveWindow();//获得与调用线程的消息队列相关的活动窗口的窗口句柄&#x000A;						if (MessageBox(hWnd, L&quot;胜败乃兵家常事，菜鸡请重新来过&quot;, L&quot;:时光机&quot;, MB_YESNO) == IDYES)//消息提示，游戏失败&#x000A;						{&#x000A;							init_game();//重新开始游戏&#x000A;						}&#x000A;						else&#x000A;						{&#x000A;							break;//退出了消息循环，结束程序&#x000A;						}&#x000A;					}&#x000A;				}&#x000A;			}&#x000A;		}&#x000A;	}&#x000A;&#x000A;	return (int)msg.wParam;&#x000A;}</textarea>
<a href="#" class="ui button" id="copy-text" style="border-left: none;">一键复制</a>
<a href="/B16041616/B16041616LiHaoMing/edit/master/message.cpp" class="ui button disabled has_tooltip edit-blob" title="无编辑权限">编辑</a>
<a href="/B16041616/B16041616LiHaoMing/raw/master/message.cpp" class="ui button edit-raw">原始数据</a>
<a href="/B16041616/B16041616LiHaoMing/blame/master/message.cpp" class="ui button edit-blame">按行查看</a>
<a href="/B16041616/B16041616LiHaoMing/commits/master/message.cpp" class="ui button edit-history">历史</a>
</div>
<script>
    if((gon.wait_fork!=undefined && gon.wait_fork==true) || (gon.wait_fetch!=undefined && gon.wait_fetch==true)){
      $('.edit-blob').popup({content:"当前项目正在后台处理中,暂时无法编辑", on: 'hover', delay: { show: 200, hide: 200 }});
      $('.edit-blob').click(function(e){
        e.preventDefault();
      })
    }
  
    setUrl = function(){
      var params = window.location.search
      if (params==undefined || $.trim(params).length==0) return;
      $('span.options').children('.basic').find('a').each(function(index,ele){
        var origin_href = $(ele).attr('href');
        if (origin_href!="#" && origin_href.indexOf('?') == -1){
          $(ele).attr('href',origin_href+params);
        }
      });
    }
  
    setUrl();
  
  
    var $btncopy = $("#copy-text");
    $(document).ready(function() {
      $btncopy.popup({
        content: isCopied ? '已复制':'点击复制'
      })
    })
    var isCopied = false;
    $btncopy.on('click', function() {
      try {
        var clipboard = new Clipboard("#copy-text", {
          text: function(trigger) {
            return $("#blob_raw").val();
          }
        });
        var success = document.execCommand('copy');
        if (success) {
          $btncopy.trigger('copied', ['已复制']);
          isCopied = true;
        } else {
          alert("复制失败，请手动复制")
        }
      } catch (err) {
        $btncopy.trigger('copied', ['点击复制']);
      }
    });
  
    $btncopy.bind('copied', function(event, message) {
      $(this).popup('hide');
      $(this).popup('destroy');
      isCopied = true;
      $(this).popup({content: isCopied ? '已复制':'点击复制'})
      $(this).popup('show');
    });
</script>
</div>
<div class='blob-description'>
<i class='iconfont icon-readme'></i>
<span class='file_name'>
message.cpp
<small>15.01 KB</small>
</span>
→
<span class='recent-commit' style='margin-top: 0.7rem'>
<a href="/B16041616" class="commit-author-link"><img alt="" avatar="B16041616" class="mini avatar circular ui image " /> <span class="commit-author-name">迷人的李胖子</span></a>
<span>提交于</span>
<span class='timeago commit-date' title='2017-12-28 08:55:47 +0800'>
2017-12-28 08:55
</span>
.
<a href="/B16041616/B16041616LiHaoMing/commit/2915f7796d098d98af815fbe8fc776698c9f2944" title="B16041616 李浩铭 message">B16041616 李浩铭 message</a>
</span>

</div>
</div>
<div class='clearfix'></div>
<div class='file_content code'>
<div class='lines white'>
<div class='line-numbers'><a href='#L1' id='L1' rel='#L#1'>1</a><a href='#L2' id='L2' rel='#L#2'>2</a><a href='#L3' id='L3' rel='#L#3'>3</a><a href='#L4' id='L4' rel='#L#4'>4</a><a href='#L5' id='L5' rel='#L#5'>5</a><a href='#L6' id='L6' rel='#L#6'>6</a><a href='#L7' id='L7' rel='#L#7'>7</a><a href='#L8' id='L8' rel='#L#8'>8</a><a href='#L9' id='L9' rel='#L#9'>9</a><a href='#L10' id='L10' rel='#L#10'>10</a><a href='#L11' id='L11' rel='#L#11'>11</a><a href='#L12' id='L12' rel='#L#12'>12</a><a href='#L13' id='L13' rel='#L#13'>13</a><a href='#L14' id='L14' rel='#L#14'>14</a><a href='#L15' id='L15' rel='#L#15'>15</a><a href='#L16' id='L16' rel='#L#16'>16</a><a href='#L17' id='L17' rel='#L#17'>17</a><a href='#L18' id='L18' rel='#L#18'>18</a><a href='#L19' id='L19' rel='#L#19'>19</a><a href='#L20' id='L20' rel='#L#20'>20</a><a href='#L21' id='L21' rel='#L#21'>21</a><a href='#L22' id='L22' rel='#L#22'>22</a><a href='#L23' id='L23' rel='#L#23'>23</a><a href='#L24' id='L24' rel='#L#24'>24</a><a href='#L25' id='L25' rel='#L#25'>25</a><a href='#L26' id='L26' rel='#L#26'>26</a><a href='#L27' id='L27' rel='#L#27'>27</a><a href='#L28' id='L28' rel='#L#28'>28</a><a href='#L29' id='L29' rel='#L#29'>29</a><a href='#L30' id='L30' rel='#L#30'>30</a><a href='#L31' id='L31' rel='#L#31'>31</a><a href='#L32' id='L32' rel='#L#32'>32</a><a href='#L33' id='L33' rel='#L#33'>33</a><a href='#L34' id='L34' rel='#L#34'>34</a><a href='#L35' id='L35' rel='#L#35'>35</a><a href='#L36' id='L36' rel='#L#36'>36</a><a href='#L37' id='L37' rel='#L#37'>37</a><a href='#L38' id='L38' rel='#L#38'>38</a><a href='#L39' id='L39' rel='#L#39'>39</a><a href='#L40' id='L40' rel='#L#40'>40</a><a href='#L41' id='L41' rel='#L#41'>41</a><a href='#L42' id='L42' rel='#L#42'>42</a><a href='#L43' id='L43' rel='#L#43'>43</a><a href='#L44' id='L44' rel='#L#44'>44</a><a href='#L45' id='L45' rel='#L#45'>45</a><a href='#L46' id='L46' rel='#L#46'>46</a><a href='#L47' id='L47' rel='#L#47'>47</a><a href='#L48' id='L48' rel='#L#48'>48</a><a href='#L49' id='L49' rel='#L#49'>49</a><a href='#L50' id='L50' rel='#L#50'>50</a><a href='#L51' id='L51' rel='#L#51'>51</a><a href='#L52' id='L52' rel='#L#52'>52</a><a href='#L53' id='L53' rel='#L#53'>53</a><a href='#L54' id='L54' rel='#L#54'>54</a><a href='#L55' id='L55' rel='#L#55'>55</a><a href='#L56' id='L56' rel='#L#56'>56</a><a href='#L57' id='L57' rel='#L#57'>57</a><a href='#L58' id='L58' rel='#L#58'>58</a><a href='#L59' id='L59' rel='#L#59'>59</a><a href='#L60' id='L60' rel='#L#60'>60</a><a href='#L61' id='L61' rel='#L#61'>61</a><a href='#L62' id='L62' rel='#L#62'>62</a><a href='#L63' id='L63' rel='#L#63'>63</a><a href='#L64' id='L64' rel='#L#64'>64</a><a href='#L65' id='L65' rel='#L#65'>65</a><a href='#L66' id='L66' rel='#L#66'>66</a><a href='#L67' id='L67' rel='#L#67'>67</a><a href='#L68' id='L68' rel='#L#68'>68</a><a href='#L69' id='L69' rel='#L#69'>69</a><a href='#L70' id='L70' rel='#L#70'>70</a><a href='#L71' id='L71' rel='#L#71'>71</a><a href='#L72' id='L72' rel='#L#72'>72</a><a href='#L73' id='L73' rel='#L#73'>73</a><a href='#L74' id='L74' rel='#L#74'>74</a><a href='#L75' id='L75' rel='#L#75'>75</a><a href='#L76' id='L76' rel='#L#76'>76</a><a href='#L77' id='L77' rel='#L#77'>77</a><a href='#L78' id='L78' rel='#L#78'>78</a><a href='#L79' id='L79' rel='#L#79'>79</a><a href='#L80' id='L80' rel='#L#80'>80</a><a href='#L81' id='L81' rel='#L#81'>81</a><a href='#L82' id='L82' rel='#L#82'>82</a><a href='#L83' id='L83' rel='#L#83'>83</a><a href='#L84' id='L84' rel='#L#84'>84</a><a href='#L85' id='L85' rel='#L#85'>85</a><a href='#L86' id='L86' rel='#L#86'>86</a><a href='#L87' id='L87' rel='#L#87'>87</a><a href='#L88' id='L88' rel='#L#88'>88</a><a href='#L89' id='L89' rel='#L#89'>89</a><a href='#L90' id='L90' rel='#L#90'>90</a><a href='#L91' id='L91' rel='#L#91'>91</a><a href='#L92' id='L92' rel='#L#92'>92</a><a href='#L93' id='L93' rel='#L#93'>93</a><a href='#L94' id='L94' rel='#L#94'>94</a><a href='#L95' id='L95' rel='#L#95'>95</a><a href='#L96' id='L96' rel='#L#96'>96</a><a href='#L97' id='L97' rel='#L#97'>97</a><a href='#L98' id='L98' rel='#L#98'>98</a><a href='#L99' id='L99' rel='#L#99'>99</a><a href='#L100' id='L100' rel='#L#100'>100</a><a href='#L101' id='L101' rel='#L#101'>101</a><a href='#L102' id='L102' rel='#L#102'>102</a><a href='#L103' id='L103' rel='#L#103'>103</a><a href='#L104' id='L104' rel='#L#104'>104</a><a href='#L105' id='L105' rel='#L#105'>105</a><a href='#L106' id='L106' rel='#L#106'>106</a><a href='#L107' id='L107' rel='#L#107'>107</a><a href='#L108' id='L108' rel='#L#108'>108</a><a href='#L109' id='L109' rel='#L#109'>109</a><a href='#L110' id='L110' rel='#L#110'>110</a><a href='#L111' id='L111' rel='#L#111'>111</a><a href='#L112' id='L112' rel='#L#112'>112</a><a href='#L113' id='L113' rel='#L#113'>113</a><a href='#L114' id='L114' rel='#L#114'>114</a><a href='#L115' id='L115' rel='#L#115'>115</a><a href='#L116' id='L116' rel='#L#116'>116</a><a href='#L117' id='L117' rel='#L#117'>117</a><a href='#L118' id='L118' rel='#L#118'>118</a><a href='#L119' id='L119' rel='#L#119'>119</a><a href='#L120' id='L120' rel='#L#120'>120</a><a href='#L121' id='L121' rel='#L#121'>121</a><a href='#L122' id='L122' rel='#L#122'>122</a><a href='#L123' id='L123' rel='#L#123'>123</a><a href='#L124' id='L124' rel='#L#124'>124</a><a href='#L125' id='L125' rel='#L#125'>125</a><a href='#L126' id='L126' rel='#L#126'>126</a><a href='#L127' id='L127' rel='#L#127'>127</a><a href='#L128' id='L128' rel='#L#128'>128</a><a href='#L129' id='L129' rel='#L#129'>129</a><a href='#L130' id='L130' rel='#L#130'>130</a><a href='#L131' id='L131' rel='#L#131'>131</a><a href='#L132' id='L132' rel='#L#132'>132</a><a href='#L133' id='L133' rel='#L#133'>133</a><a href='#L134' id='L134' rel='#L#134'>134</a><a href='#L135' id='L135' rel='#L#135'>135</a><a href='#L136' id='L136' rel='#L#136'>136</a><a href='#L137' id='L137' rel='#L#137'>137</a><a href='#L138' id='L138' rel='#L#138'>138</a><a href='#L139' id='L139' rel='#L#139'>139</a><a href='#L140' id='L140' rel='#L#140'>140</a><a href='#L141' id='L141' rel='#L#141'>141</a><a href='#L142' id='L142' rel='#L#142'>142</a><a href='#L143' id='L143' rel='#L#143'>143</a><a href='#L144' id='L144' rel='#L#144'>144</a><a href='#L145' id='L145' rel='#L#145'>145</a><a href='#L146' id='L146' rel='#L#146'>146</a><a href='#L147' id='L147' rel='#L#147'>147</a><a href='#L148' id='L148' rel='#L#148'>148</a><a href='#L149' id='L149' rel='#L#149'>149</a><a href='#L150' id='L150' rel='#L#150'>150</a><a href='#L151' id='L151' rel='#L#151'>151</a><a href='#L152' id='L152' rel='#L#152'>152</a><a href='#L153' id='L153' rel='#L#153'>153</a><a href='#L154' id='L154' rel='#L#154'>154</a><a href='#L155' id='L155' rel='#L#155'>155</a><a href='#L156' id='L156' rel='#L#156'>156</a><a href='#L157' id='L157' rel='#L#157'>157</a><a href='#L158' id='L158' rel='#L#158'>158</a><a href='#L159' id='L159' rel='#L#159'>159</a><a href='#L160' id='L160' rel='#L#160'>160</a><a href='#L161' id='L161' rel='#L#161'>161</a><a href='#L162' id='L162' rel='#L#162'>162</a><a href='#L163' id='L163' rel='#L#163'>163</a><a href='#L164' id='L164' rel='#L#164'>164</a><a href='#L165' id='L165' rel='#L#165'>165</a><a href='#L166' id='L166' rel='#L#166'>166</a><a href='#L167' id='L167' rel='#L#167'>167</a><a href='#L168' id='L168' rel='#L#168'>168</a><a href='#L169' id='L169' rel='#L#169'>169</a><a href='#L170' id='L170' rel='#L#170'>170</a><a href='#L171' id='L171' rel='#L#171'>171</a><a href='#L172' id='L172' rel='#L#172'>172</a><a href='#L173' id='L173' rel='#L#173'>173</a><a href='#L174' id='L174' rel='#L#174'>174</a><a href='#L175' id='L175' rel='#L#175'>175</a><a href='#L176' id='L176' rel='#L#176'>176</a><a href='#L177' id='L177' rel='#L#177'>177</a><a href='#L178' id='L178' rel='#L#178'>178</a><a href='#L179' id='L179' rel='#L#179'>179</a><a href='#L180' id='L180' rel='#L#180'>180</a><a href='#L181' id='L181' rel='#L#181'>181</a><a href='#L182' id='L182' rel='#L#182'>182</a><a href='#L183' id='L183' rel='#L#183'>183</a><a href='#L184' id='L184' rel='#L#184'>184</a><a href='#L185' id='L185' rel='#L#185'>185</a><a href='#L186' id='L186' rel='#L#186'>186</a><a href='#L187' id='L187' rel='#L#187'>187</a><a href='#L188' id='L188' rel='#L#188'>188</a><a href='#L189' id='L189' rel='#L#189'>189</a><a href='#L190' id='L190' rel='#L#190'>190</a><a href='#L191' id='L191' rel='#L#191'>191</a><a href='#L192' id='L192' rel='#L#192'>192</a><a href='#L193' id='L193' rel='#L#193'>193</a><a href='#L194' id='L194' rel='#L#194'>194</a><a href='#L195' id='L195' rel='#L#195'>195</a><a href='#L196' id='L196' rel='#L#196'>196</a><a href='#L197' id='L197' rel='#L#197'>197</a><a href='#L198' id='L198' rel='#L#198'>198</a><a href='#L199' id='L199' rel='#L#199'>199</a><a href='#L200' id='L200' rel='#L#200'>200</a><a href='#L201' id='L201' rel='#L#201'>201</a><a href='#L202' id='L202' rel='#L#202'>202</a><a href='#L203' id='L203' rel='#L#203'>203</a><a href='#L204' id='L204' rel='#L#204'>204</a><a href='#L205' id='L205' rel='#L#205'>205</a><a href='#L206' id='L206' rel='#L#206'>206</a><a href='#L207' id='L207' rel='#L#207'>207</a><a href='#L208' id='L208' rel='#L#208'>208</a><a href='#L209' id='L209' rel='#L#209'>209</a><a href='#L210' id='L210' rel='#L#210'>210</a><a href='#L211' id='L211' rel='#L#211'>211</a><a href='#L212' id='L212' rel='#L#212'>212</a><a href='#L213' id='L213' rel='#L#213'>213</a><a href='#L214' id='L214' rel='#L#214'>214</a><a href='#L215' id='L215' rel='#L#215'>215</a><a href='#L216' id='L216' rel='#L#216'>216</a><a href='#L217' id='L217' rel='#L#217'>217</a><a href='#L218' id='L218' rel='#L#218'>218</a><a href='#L219' id='L219' rel='#L#219'>219</a><a href='#L220' id='L220' rel='#L#220'>220</a><a href='#L221' id='L221' rel='#L#221'>221</a><a href='#L222' id='L222' rel='#L#222'>222</a><a href='#L223' id='L223' rel='#L#223'>223</a><a href='#L224' id='L224' rel='#L#224'>224</a><a href='#L225' id='L225' rel='#L#225'>225</a><a href='#L226' id='L226' rel='#L#226'>226</a><a href='#L227' id='L227' rel='#L#227'>227</a><a href='#L228' id='L228' rel='#L#228'>228</a><a href='#L229' id='L229' rel='#L#229'>229</a><a href='#L230' id='L230' rel='#L#230'>230</a><a href='#L231' id='L231' rel='#L#231'>231</a><a href='#L232' id='L232' rel='#L#232'>232</a><a href='#L233' id='L233' rel='#L#233'>233</a><a href='#L234' id='L234' rel='#L#234'>234</a><a href='#L235' id='L235' rel='#L#235'>235</a><a href='#L236' id='L236' rel='#L#236'>236</a><a href='#L237' id='L237' rel='#L#237'>237</a><a href='#L238' id='L238' rel='#L#238'>238</a><a href='#L239' id='L239' rel='#L#239'>239</a><a href='#L240' id='L240' rel='#L#240'>240</a><a href='#L241' id='L241' rel='#L#241'>241</a><a href='#L242' id='L242' rel='#L#242'>242</a><a href='#L243' id='L243' rel='#L#243'>243</a><a href='#L244' id='L244' rel='#L#244'>244</a><a href='#L245' id='L245' rel='#L#245'>245</a><a href='#L246' id='L246' rel='#L#246'>246</a><a href='#L247' id='L247' rel='#L#247'>247</a><a href='#L248' id='L248' rel='#L#248'>248</a><a href='#L249' id='L249' rel='#L#249'>249</a><a href='#L250' id='L250' rel='#L#250'>250</a><a href='#L251' id='L251' rel='#L#251'>251</a><a href='#L252' id='L252' rel='#L#252'>252</a><a href='#L253' id='L253' rel='#L#253'>253</a><a href='#L254' id='L254' rel='#L#254'>254</a><a href='#L255' id='L255' rel='#L#255'>255</a><a href='#L256' id='L256' rel='#L#256'>256</a><a href='#L257' id='L257' rel='#L#257'>257</a><a href='#L258' id='L258' rel='#L#258'>258</a><a href='#L259' id='L259' rel='#L#259'>259</a><a href='#L260' id='L260' rel='#L#260'>260</a><a href='#L261' id='L261' rel='#L#261'>261</a><a href='#L262' id='L262' rel='#L#262'>262</a><a href='#L263' id='L263' rel='#L#263'>263</a><a href='#L264' id='L264' rel='#L#264'>264</a><a href='#L265' id='L265' rel='#L#265'>265</a><a href='#L266' id='L266' rel='#L#266'>266</a><a href='#L267' id='L267' rel='#L#267'>267</a><a href='#L268' id='L268' rel='#L#268'>268</a><a href='#L269' id='L269' rel='#L#269'>269</a><a href='#L270' id='L270' rel='#L#270'>270</a><a href='#L271' id='L271' rel='#L#271'>271</a><a href='#L272' id='L272' rel='#L#272'>272</a><a href='#L273' id='L273' rel='#L#273'>273</a><a href='#L274' id='L274' rel='#L#274'>274</a><a href='#L275' id='L275' rel='#L#275'>275</a><a href='#L276' id='L276' rel='#L#276'>276</a><a href='#L277' id='L277' rel='#L#277'>277</a><a href='#L278' id='L278' rel='#L#278'>278</a><a href='#L279' id='L279' rel='#L#279'>279</a><a href='#L280' id='L280' rel='#L#280'>280</a><a href='#L281' id='L281' rel='#L#281'>281</a><a href='#L282' id='L282' rel='#L#282'>282</a><a href='#L283' id='L283' rel='#L#283'>283</a><a href='#L284' id='L284' rel='#L#284'>284</a><a href='#L285' id='L285' rel='#L#285'>285</a><a href='#L286' id='L286' rel='#L#286'>286</a><a href='#L287' id='L287' rel='#L#287'>287</a><a href='#L288' id='L288' rel='#L#288'>288</a><a href='#L289' id='L289' rel='#L#289'>289</a><a href='#L290' id='L290' rel='#L#290'>290</a><a href='#L291' id='L291' rel='#L#291'>291</a><a href='#L292' id='L292' rel='#L#292'>292</a></div><div class='highlight'><pre><div class='line' id='LC1'><span class="err">﻿</span><span class="c1">// message.cpp: 定义控制台应用程序的入口点。
</div><div class='line' id='LC2'>//
</div><div class='line' id='LC3'></span>
</div><div class='line' id='LC4'><span class="cp">#include "stdafx.h"</span>
</div><div class='line' id='LC5'><span class='cp'>#include&lt;Windows.h&gt;</span>
</div><div class='line' id='LC6'><span class='cp'></span>
</div><div class='line' id='LC7'>
</div><div class='line' id='LC8'><span class="kt">int</span> <span class="n">RandomInt</span><span class="p">(</span><span class="kt">int</span> <span class="n">_min</span><span class="p">,</span> <span class="kt">int</span> <span class="n">_max</span><span class="p">);</span>       <span class="c1">//获取一个随机int
</div><div class='line' id='LC9'></span><span class="kt">int</span> <span class="n">CheckValide</span><span class="p">(</span><span class="kt">int</span> <span class="n">curPosX</span><span class="p">,</span> <span class="kt">int</span> <span class="n">curPosY</span><span class="p">,</span> <span class="n">BOOL</span> <span class="n">bCurTeris</span><span class="p">[</span><span class="mi">4</span><span class="p">][</span><span class="mi">4</span><span class="p">]);</span>   <span class="c1">//给定一个矩阵，查看是否合法
</div><div class='line' id='LC10'></span><span class="kt">int</span> <span class="n">selectDiffculty</span><span class="p">(</span><span class="n">HWND</span> <span class="n">hWnd</span><span class="p">,</span> <span class="kt">int</span> <span class="n">dif</span><span class="p">);</span>
</div><div class='line' id='LC11'><span class="kt">int</span> <span class="n">selectLayOut</span><span class="p">(</span><span class="n">HWND</span> <span class="n">hWnd</span><span class="p">,</span> <span class="kt">int</span> <span class="n">layout</span><span class="p">);</span>
</div><div class='line' id='LC12'>
</div><div class='line' id='LC13'><span class="c1">//常量声明</span>
</div><div class='line' id='LC14'><span class='c1'></span><span class="k">const</span> <span class="kt">int</span> <span class="n">BORDER_X</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span></span>
</div><div class='line' id='LC15'><span class='c1'><span class="k">const</span> <span class="kt">int</span> <span class="n">BORDER_Y</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
</div><div class='line' id='LC16'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_LEFT_X</span> <span class="o">=</span> <span class="mi">300</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">;</span>
</div><div class='line' id='LC17'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_Y</span> <span class="o">=</span> <span class="mi">600</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">;</span>
</div><div class='line' id='LC18'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_RIGHT_X</span> <span class="o">=</span> <span class="mi">180</span> <span class="o">+</span> <span class="n">BORDER_X</span> <span class="o">*</span> <span class="mi">2</span><span class="p">;</span>
</div><div class='line' id='LC19'><span class="k">const</span> <span class="kt">int</span> <span class="n">SCREEN_X</span> <span class="o">=</span> <span class="n">SCREEN_LEFT_X</span> <span class="o">+</span> <span class="n">SCREEN_RIGHT_X</span><span class="p">;</span>
</div><div class='line' id='LC20'><span class="k">const</span> <span class="n">BOOL</span> <span class="n">state_teris</span><span class="p">[][</span><span class="mi">4</span><span class="p">][</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span>
</div><div class='line' id='LC21'><span class="p">{</span>
</div><div class='line' id='LC22'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">},</span>
</div><div class='line' id='LC23'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">},</span>
</div><div class='line' id='LC24'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">},</span>
</div><div class='line' id='LC25'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">},</span>
</div><div class='line' id='LC26'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">},</span>
</div><div class='line' id='LC27'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">},</span>
</div><div class='line' id='LC28'>	<span class="p">{</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">},{</span> <span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span> <span class="p">}</span> <span class="p">}</span>
</div><div class='line' id='LC29'><span class="p">};</span>
</div><div class='line' id='LC30'>
</div><div class='line' id='LC31'><span class="cp">#define IDS_APP_TITLE			103</span>
</div><div class='line' id='LC32'><span class='cp'></span>
</div><div class='line' id='LC33'><span class="cp">#define IDR_MAINFRAME			128</span>
</div><div class='line' id='LC34'><span class='cp'>#define IDD_TETRIS_DIALOG	102</span>
</div><div class='line' id='LC35'><span class='cp'>#define IDD_ABOUTBOX			103</span>
</div><div class='line' id='LC36'><span class='cp'>#define IDM_ABOUT				104</span>
</div><div class='line' id='LC37'><span class='cp'>#define IDM_EXIT				105</span>
</div><div class='line' id='LC38'><span class='cp'>#define IDM_START 116</span>
</div><div class='line' id='LC39'><span class='cp'>#define IDM_END 117</span>
</div><div class='line' id='LC40'><span class='cp'>#define IDM_DIFF 106</span>
</div><div class='line' id='LC41'><span class='cp'>#define ID_dif1 111</span>
</div><div class='line' id='LC42'><span class='cp'>#define ID_dif2 112</span>
</div><div class='line' id='LC43'><span class='cp'>#define ID_dif3 113</span>
</div><div class='line' id='LC44'><span class='cp'>#define ID_LAYOUT1 114</span>
</div><div class='line' id='LC45'><span class='cp'>#define ID_LAYOUT2 115</span>
</div><div class='line' id='LC46'><span class='cp'>#define IDI_TETRIS			107</span>
</div><div class='line' id='LC47'><span class='cp'>#define IDI_SMALL				108</span>
</div><div class='line' id='LC48'><span class='cp'>#define IDC_TETRIS			109</span>
</div><div class='line' id='LC49'><span class='cp'>#define IDC_MYICON				2</span>
</div><div class='line' id='LC50'><span class='cp'>#ifndef IDC_STATIC</span>
</div><div class='line' id='LC51'><span class='cp'>#define IDC_STATIC				-1</span>
</div><div class='line' id='LC52'><span class='cp'>#endif</span>
</div><div class='line' id='LC53'><span class='cp'></span>
</div><div class='line' id='LC54'><span class="cp">#define MAX_LOADSTRING 100 </span>
</div><div class='line' id='LC55'><span class='cp'></span><span class="c1">// 此代码模块中包含的函数的前向声明: 
</div><div class='line' id='LC56'></span><span class="n">ATOM</span>                <span class="n">MyRegisterClass</span><span class="p">(</span><span class="n">HINSTANCE</span> <span class="n">hInstance</span><span class="p">);</span><span class="c1">//窗口注册函数
</div><div class='line' id='LC57'></span><span class="n">BOOL</span>                <span class="n">InitInstance</span><span class="p">(</span><span class="n">HINSTANCE</span><span class="p">,</span> <span class="kt">int</span><span class="p">);</span><span class="c1">//在启动时初始化应用程序
</div><div class='line' id='LC58'></span><span class="n">LRESULT</span> <span class="n">CALLBACK</span>    <span class="n">WndProc</span><span class="p">(</span><span class="n">HWND</span><span class="p">,</span> <span class="n">UINT</span><span class="p">,</span> <span class="n">WPARAM</span><span class="p">,</span> <span class="n">LPARAM</span><span class="p">);</span><span class="c1">//窗口过程处理函数
</div><div class='line' id='LC59'></span><span class="n">INT_PTR</span> <span class="n">CALLBACK</span>    <span class="n">About</span><span class="p">(</span><span class="n">HWND</span><span class="p">,</span> <span class="n">UINT</span><span class="p">,</span> <span class="n">WPARAM</span><span class="p">,</span> <span class="n">LPARAM</span><span class="p">);</span>
</div><div class='line' id='LC60'>
</div><div class='line' id='LC61'><span class="c1">// 全局变量: </span>
</div><div class='line' id='LC62'><span class='c1'></span><span class="n">HINSTANCE</span> <span class="n">hInst</span><span class="p">;</span>                               <span class="c1">// 当前实例</span>
</div><div class='line' id='LC63'><span class='c1'></span><span class="n">WCHAR</span> <span class="n">szTitle</span><span class="p">[</span><span class="n">MAX_LOADSTRING</span><span class="p">];</span>                  <span class="c1">// 标题栏文本</span>
</div><div class='line' id='LC64'><span class='c1'></span><span class="n">WCHAR</span> <span class="n">szWindowClass</span><span class="p">[</span><span class="n">MAX_LOADSTRING</span><span class="p">];</span>            <span class="c1">// 主窗口类名</span>
</div><div class='line' id='LC65'><span class='c1'></span><span class="n">HMENU</span> <span class="n">diff</span><span class="p">;</span><span class="c1">//难度菜单句柄的定义</span>
</div><div class='line' id='LC66'><span class='c1'></span><span class="n">HMENU</span> <span class="n">lay</span><span class="p">;</span><span class="c1">//布局菜单句柄的定义</span>
</div><div class='line' id='LC67'><span class='c1'></span><span class="n">HMENU</span> <span class="n">start</span><span class="p">;</span></span>
</div><div class='line' id='LC68'><span class='c1'><span class="n">HMENU</span> <span class="n">end</span><span class="p">;</span>
</div><div class='line' id='LC69'>
</div><div class='line' id='LC70'><span class="kt">bool</span> <span class="n">g_hasBlocked</span><span class="p">[</span><span class="mi">50</span><span class="p">][</span><span class="mi">50</span><span class="p">];</span>
</div><div class='line' id='LC71'><span class="n">RECT</span> <span class="n">rc_left</span><span class="p">,</span> <span class="n">rc_right</span><span class="p">,</span> <span class="n">rc_right_top</span><span class="p">,</span> <span class="n">rc_right_bottom</span><span class="p">,</span> <span class="n">rc_main</span><span class="p">;</span>
</div><div class='line' id='LC72'><span class="kt">int</span> <span class="n">g_speed</span> <span class="o">=</span> <span class="mi">300</span><span class="p">;</span>
</div><div class='line' id='LC73'><span class="kt">int</span> <span class="n">t_speed</span> <span class="o">=</span> <span class="mi">300</span><span class="p">;</span>
</div><div class='line' id='LC74'><span class="n">BOOL</span> <span class="n">bCurTeris</span><span class="p">[</span><span class="mi">4</span><span class="p">][</span><span class="mi">4</span><span class="p">];</span>
</div><div class='line' id='LC75'><span class="n">BOOL</span> <span class="n">bNextCurTeris</span><span class="p">[</span><span class="mi">4</span><span class="p">][</span><span class="mi">4</span><span class="p">];</span>
</div><div class='line' id='LC76'><span class="kt">int</span> <span class="n">curPosX</span><span class="p">,</span> <span class="n">curPosY</span><span class="p">;</span>
</div><div class='line' id='LC77'><span class="kt">int</span> <span class="n">rd_seed</span> <span class="o">=</span> <span class="mi">1995421</span><span class="p">;</span>
</div><div class='line' id='LC78'><span class="kt">int</span> <span class="n">tPre</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">tCur</span><span class="p">;</span>
</div><div class='line' id='LC79'><span class="kt">int</span> <span class="n">GAME_STATE</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC80'><span class="kt">int</span> <span class="n">GAME_SCORE</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC81'><span class="kt">int</span> <span class="n">GAME_DIFF</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
</div><div class='line' id='LC82'><span class="kt">int</span> <span class="n">NUM_X</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
</div><div class='line' id='LC83'><span class="kt">int</span> <span class="n">NUM_Y</span> <span class="o">=</span> <span class="mi">20</span><span class="p">;</span>
</div><div class='line' id='LC84'><span class="kt">int</span> <span class="n">BLOCK_SIZE</span> <span class="o">=</span> <span class="mi">30</span><span class="p">;</span>
</div><div class='line' id='LC85'>
</div><div class='line' id='LC86'><span class="kt">void</span> <span class="n">setRandomT</span><span class="p">();</span>
</div><div class='line' id='LC87'><span class="kt">void</span> <span class="nf">init_game</span><span class="p">()</span>
</div><div class='line' id='LC88'><span class="p">{</span>
</div><div class='line' id='LC89'>	<span class="n">GAME_SCORE</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC90'>	<span class="n">setRandomT</span><span class="p">();</span><span class="c1">//随机生成一个方块用作下一次掉落
</div><div class='line' id='LC91'></span>	<span class="n">curPosX</span> <span class="o">=</span> <span class="p">(</span><span class="n">NUM_X</span> <span class="o">-</span> <span class="mi">4</span><span class="p">)</span> <span class="o">&gt;&gt;</span> <span class="mi">1</span><span class="p">;</span><span class="c1">//设置初始坐标
</div><div class='line' id='LC92'></span>	<span class="n">curPosY</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC93'>	<span class="c1">//memset，是计算机语言中的函数。起功能是将s所指向的某一块内存中的每个字节的内容全部设置为ch指定的ASCII值，最后行清零</span>
</div><div class='line' id='LC94'><span class='c1'></span>	<span class="n">memset</span><span class="p">(</span><span class="n">g_hasBlocked</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">g_hasBlocked</span><span class="p">));</span></span>
</div><div class='line' id='LC95'><span class='c1'>	<span class="n">rc_left</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC96'>	<span class="n">rc_left</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">SCREEN_LEFT_X</span><span class="p">;</span>
</div><div class='line' id='LC97'>	<span class="n">rc_left</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC98'>	<span class="n">rc_left</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">SCREEN_Y</span><span class="p">;</span>
</div><div class='line' id='LC99'>
</div><div class='line' id='LC100'>	<span class="n">rc_right</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">rc_left</span><span class="p">.</span><span class="n">right</span> <span class="o">+</span> <span class="n">BORDER_X</span><span class="p">;</span>
</div><div class='line' id='LC101'>	<span class="n">rc_right</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="mi">180</span> <span class="o">+</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">left</span><span class="p">;</span>
</div><div class='line' id='LC102'>	<span class="n">rc_right</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC103'>	<span class="n">rc_right</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">SCREEN_Y</span><span class="p">;</span>
</div><div class='line' id='LC104'>
</div><div class='line' id='LC105'>	<span class="n">rc_main</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC106'>	<span class="n">rc_main</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">SCREEN_X</span><span class="p">;</span>
</div><div class='line' id='LC107'>	<span class="n">rc_main</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC108'>	<span class="n">rc_main</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">SCREEN_Y</span><span class="p">;</span>
</div><div class='line' id='LC109'>
</div><div class='line' id='LC110'>	<span class="n">rc_right_top</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">left</span><span class="p">;</span>
</div><div class='line' id='LC111'>	<span class="n">rc_right_top</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">top</span><span class="p">;</span>
</div><div class='line' id='LC112'>	<span class="n">rc_right_top</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">right</span><span class="p">;</span>
</div><div class='line' id='LC113'>	<span class="n">rc_right_top</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="p">(</span><span class="n">rc_right</span><span class="p">.</span><span class="n">bottom</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">;</span>
</div><div class='line' id='LC114'>
</div><div class='line' id='LC115'>	<span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">left</span> <span class="o">=</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">left</span><span class="p">;</span>
</div><div class='line' id='LC116'>	<span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">top</span> <span class="o">=</span> <span class="n">rc_right_top</span><span class="p">.</span><span class="n">bottom</span> <span class="o">+</span> <span class="n">BORDER_Y</span><span class="p">;</span>
</div><div class='line' id='LC117'>	<span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">right</span> <span class="o">=</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">right</span><span class="p">;</span>
</div><div class='line' id='LC118'>	<span class="n">rc_right_bottom</span><span class="p">.</span><span class="n">bottom</span> <span class="o">=</span> <span class="n">rc_right</span><span class="p">.</span><span class="n">bottom</span><span class="p">;</span>
</div><div class='line' id='LC119'>
</div><div class='line' id='LC120'>	<span class="n">g_speed</span> <span class="o">=</span> <span class="n">t_speed</span> <span class="o">=</span> <span class="mi">1000</span> <span class="o">-</span> <span class="n">GAME_DIFF</span> <span class="o">*</span> <span class="mi">280</span><span class="p">;</span>
</div><div class='line' id='LC121'><span class="p">}</span>
</div><div class='line' id='LC122'>
</div><div class='line' id='LC123'><span class="kt">void</span> <span class="nf">fillBlock</span><span class="p">()</span><span class="c1">//到达底部后填充矩阵
</div><div class='line' id='LC124'></span><span class="p">{</span>
</div><div class='line' id='LC125'>	<span class="kt">int</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">;</span>
</div><div class='line' id='LC126'>	<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span><span class="o">&lt;</span><span class="mi">4</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC127'>	<span class="p">{</span>
</div><div class='line' id='LC128'>		<span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">j</span><span class="o">&lt;</span><span class="mi">4</span><span class="p">;</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC129'>		<span class="p">{</span>
</div><div class='line' id='LC130'>			<span class="k">if</span> <span class="p">(</span><span class="n">bCurTeris</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
</div><div class='line' id='LC131'>			<span class="p">{</span>
</div><div class='line' id='LC132'>				<span class="n">g_hasBlocked</span><span class="p">[</span><span class="n">curPosY</span> <span class="o">+</span> <span class="n">i</span><span class="p">][</span><span class="n">curPosX</span> <span class="o">+</span> <span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
</div><div class='line' id='LC133'>			<span class="p">}</span>
</div><div class='line' id='LC134'>		<span class="p">}</span>
</div><div class='line' id='LC135'>	<span class="p">}</span>
</div><div class='line' id='LC136'><span class="p">}</span>
</div><div class='line' id='LC137'>
</div><div class='line' id='LC138'><span class="kt">void</span> <span class="nf">setRandomT</span><span class="p">()</span>
</div><div class='line' id='LC139'><span class="p">{</span>
</div><div class='line' id='LC140'>	<span class="kt">int</span> <span class="n">rd_start</span> <span class="o">=</span> <span class="n">RandomInt</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">)</span> <span class="o">/</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">[</span><span class="mi">0</span><span class="p">]));</span>
</div><div class='line' id='LC141'>	<span class="kt">int</span> <span class="n">rd_next</span> <span class="o">=</span> <span class="n">RandomInt</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">)</span> <span class="o">/</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">[</span><span class="mi">0</span><span class="p">]));</span>
</div><div class='line' id='LC142'>	<span class="c1">//outPutBoxInt(rd_start);</span>
</div><div class='line' id='LC143'><span class='c1'></span>	<span class="c1">//outPutBoxInt(rd_next);</span>
</div><div class='line' id='LC144'><span class='c1'></span>	<span class="c1">//outPutBoxInt(rd_start);</span>
</div><div class='line' id='LC145'><span class='c1'></span>	<span class="k">if</span> <span class="p">(</span><span class="n">GAME_STATE</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span></span>
</div><div class='line' id='LC146'><span class='c1'>	<span class="p">{</span>
</div><div class='line' id='LC147'>		<span class="n">GAME_STATE</span> <span class="o">=</span> <span class="n">GAME_STATE</span> <span class="o">|</span> <span class="mh">0x0001</span><span class="p">;</span>
</div><div class='line' id='LC148'>		<span class="c1">//outPutBoxInt(GAME_STATE);</span>
</div><div class='line' id='LC149'><span class='c1'></span>		<span class="n">memcpy</span><span class="p">(</span><span class="n">bCurTeris</span><span class="p">,</span> <span class="n">state_teris</span><span class="p">[</span><span class="n">rd_start</span><span class="p">],</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">[</span><span class="n">rd_start</span><span class="p">]));</span></span>
</div><div class='line' id='LC150'><span class='c1'>		<span class="n">memcpy</span><span class="p">(</span><span class="n">bNextCurTeris</span><span class="p">,</span> <span class="n">state_teris</span><span class="p">[</span><span class="n">rd_next</span><span class="p">],</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">[</span><span class="n">rd_next</span><span class="p">]));</span>
</div><div class='line' id='LC151'>	<span class="p">}</span>
</div><div class='line' id='LC152'>	<span class="k">else</span>
</div><div class='line' id='LC153'>	<span class="p">{</span>
</div><div class='line' id='LC154'>		<span class="n">memcpy</span><span class="p">(</span><span class="n">bCurTeris</span><span class="p">,</span> <span class="n">bNextCurTeris</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">bNextCurTeris</span><span class="p">));</span>
</div><div class='line' id='LC155'>		<span class="n">memcpy</span><span class="p">(</span><span class="n">bNextCurTeris</span><span class="p">,</span> <span class="n">state_teris</span><span class="p">[</span><span class="n">rd_next</span><span class="p">],</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">state_teris</span><span class="p">[</span><span class="n">rd_next</span><span class="p">]));</span>
</div><div class='line' id='LC156'>	<span class="p">}</span>
</div><div class='line' id='LC157'>
</div><div class='line' id='LC158'><span class="p">}</span>
</div><div class='line' id='LC159'><span class="kt">void</span> <span class="nf">drawCompleteParticle</span><span class="p">(</span><span class="kt">int</span> <span class="n">line</span><span class="p">)</span>
</div><div class='line' id='LC160'><span class="p">{</span>
</div><div class='line' id='LC161'>	<span class="n">HWND</span> <span class="n">hWnd</span> <span class="o">=</span> <span class="n">GetActiveWindow</span><span class="p">();</span>
</div><div class='line' id='LC162'>	<span class="n">HDC</span> <span class="n">hdc</span> <span class="o">=</span> <span class="n">GetDC</span><span class="p">(</span><span class="n">hWnd</span><span class="p">);</span>
</div><div class='line' id='LC163'>	<span class="n">HBRUSH</span> <span class="n">hBrush</span> <span class="o">=</span> <span class="p">(</span><span class="n">HBRUSH</span><span class="p">)</span><span class="n">GetStockObject</span><span class="p">(</span><span class="n">GRAY_BRUSH</span><span class="p">);</span>
</div><div class='line' id='LC164'>	<span class="n">HPEN</span> <span class="n">hPen</span> <span class="o">=</span> <span class="p">(</span><span class="n">HPEN</span><span class="p">)</span><span class="n">CreatePen</span><span class="p">(</span><span class="n">PS_DOT</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">RGB</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">));</span>
</div><div class='line' id='LC165'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC166'>	<span class="n">SelectObject</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">hPen</span><span class="p">);</span>
</div><div class='line' id='LC167'>	<span class="n">Rectangle</span><span class="p">(</span><span class="n">hdc</span><span class="p">,</span> <span class="n">BORDER_X</span><span class="p">,</span>
</div><div class='line' id='LC168'>		<span class="n">BORDER_Y</span> <span class="o">+</span> <span class="n">line</span><span class="o">*</span><span class="n">BLOCK_SIZE</span><span class="p">,</span>
</div><div class='line' id='LC169'>		<span class="n">BORDER_X</span> <span class="o">+</span> <span class="n">NUM_X</span><span class="o">*</span><span class="n">BLOCK_SIZE</span><span class="p">,</span>
</div><div class='line' id='LC170'>		<span class="n">BORDER_Y</span> <span class="o">+</span> <span class="n">BLOCK_SIZE</span><span class="o">*</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">line</span><span class="p">));</span>
</div><div class='line' id='LC171'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hBrush</span><span class="p">);</span>
</div><div class='line' id='LC172'>	<span class="n">DeleteObject</span><span class="p">(</span><span class="n">hPen</span><span class="p">);</span>
</div><div class='line' id='LC173'><span class="p">}</span>
</div><div class='line' id='LC174'>
</div><div class='line' id='LC175'><span class="kt">void</span> <span class="nf">checkComplite</span><span class="p">()</span><span class="c1">//查看一行是否能消去
</div><div class='line' id='LC176'></span><span class="p">{</span>
</div><div class='line' id='LC177'>	<span class="kt">int</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</div><div class='line' id='LC178'>	<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span><span class="o">&lt;</span><span class="n">NUM_Y</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC179'>	<span class="p">{</span>
</div><div class='line' id='LC180'>		<span class="kt">bool</span> <span class="n">flag</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
</div><div class='line' id='LC181'>		<span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">j</span><span class="o">&lt;</span><span class="n">NUM_X</span><span class="p">;</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC182'>		<span class="p">{</span>
</div><div class='line' id='LC183'>			<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">g_hasBlocked</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
</div><div class='line' id='LC184'>			<span class="p">{</span>
</div><div class='line' id='LC185'>				<span class="n">flag</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span><span class="c1">//有一个为空时，不能消去
</div><div class='line' id='LC186'></span>			<span class="p">}</span>
</div><div class='line' id='LC187'>		<span class="p">}</span>
</div><div class='line' id='LC188'>		<span class="k">if</span> <span class="p">(</span><span class="n">flag</span><span class="p">)</span>
</div><div class='line' id='LC189'>		<span class="p">{</span>
</div><div class='line' id='LC190'>			<span class="n">count</span><span class="o">++</span><span class="p">;</span>
</div><div class='line' id='LC191'>			<span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="n">i</span><span class="p">;</span> <span class="n">j</span> <span class="o">&gt;=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">j</span><span class="o">--</span><span class="p">)</span><span class="c1">//从上往下把每行下移
</div><div class='line' id='LC192'></span>			<span class="p">{</span>
</div><div class='line' id='LC193'>				<span class="k">for</span> <span class="p">(</span><span class="n">k</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">k</span><span class="o">&lt;</span><span class="n">NUM_X</span><span class="p">;</span> <span class="n">k</span><span class="o">++</span><span class="p">)</span>
</div><div class='line' id='LC194'>				<span class="p">{</span>
</div><div class='line' id='LC195'>					<span class="n">g_hasBlocked</span><span class="p">[</span><span class="n">j</span><span class="p">][</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_hasBlocked</span><span class="p">[</span><span class="n">j</span> <span class="o">-</span> <span class="mi">1</span><span class="p">][</span><span class="n">k</span><span class="p">];</span>
</div><div class='line' id='LC196'>				<span class="p">}</span>
</div><div class='line' id='LC197'>
</div><div class='line' id='LC198'>			<span class="p">}</span>
</div><div class='line' id='LC199'>			<span class="n">drawCompleteParticle</span><span class="p">(</span><span class="n">i</span><span class="p">);</span><span class="c1">//在消去的那行画一行空白做出消去的效果
</div><div class='line' id='LC200'></span>			<span class="n">Sleep</span><span class="p">(</span><span class="mi">300</span><span class="p">);</span><span class="c1">//暂停300ms
</div><div class='line' id='LC201'></span>
</div><div class='line' id='LC202'>			<span class="n">PlaySound</span><span class="p">(</span><span class="n">_T</span><span class="p">(</span><span class="s">"coin.wav"</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">,</span> <span class="n">SND_FILENAME</span> <span class="o">|</span> <span class="n">SND_ASYNC</span><span class="p">);</span><span class="c1">//消去一行时播放系统自带提示音
</div><div class='line' id='LC203'></span>		<span class="p">}</span>
</div><div class='line' id='LC204'>	<span class="p">}</span>
</div><div class='line' id='LC205'>	<span class="n">GAME_SCORE</span> <span class="o">+=</span> <span class="kt">int</span><span class="p">(</span><span class="n">count</span><span class="o">*</span><span class="mf">1.5</span><span class="p">);</span><span class="c1">//单行+1分，两行+3分，三行+4分，四行6分，以此类推
</div><div class='line' id='LC206'></span><span class="p">}</span>
</div><div class='line' id='LC207'>
</div><div class='line' id='LC208'><span class="kt">int</span> <span class="n">APIENTRY</span> <span class="nf">wWinMain</span><span class="p">(</span><span class="n">HINSTANCE</span> <span class="n">hInstance</span><span class="p">,</span><span class="c1">//应用程序当前实例句柄
</div><div class='line' id='LC209'></span>	<span class="n">HINSTANCE</span> <span class="n">hPrevInstance</span><span class="p">,</span><span class="c1">//应用程序其他实例句柄
</div><div class='line' id='LC210'></span>	<span class="n">LPWSTR</span>    <span class="n">lpCmdLine</span><span class="p">,</span><span class="c1">//指向程序命令行参数的指针
</div><div class='line' id='LC211'></span>	<span class="kt">int</span>       <span class="n">nCmdShow</span><span class="p">)</span><span class="c1">//应用程序开始执行时窗口显示方式的整数值标识
</div><div class='line' id='LC212'></span><span class="p">{</span>
</div><div class='line' id='LC213'>	<span class="n">init_game</span><span class="p">();</span><span class="c1">//初始化游戏
</div><div class='line' id='LC214'></span>	<span class="n">UNREFERENCED_PARAMETER</span><span class="p">(</span><span class="n">hPrevInstance</span><span class="p">);</span><span class="c1">//展开传递的参数或表达式
</div><div class='line' id='LC215'></span>	<span class="n">UNREFERENCED_PARAMETER</span><span class="p">(</span><span class="n">lpCmdLine</span><span class="p">);</span><span class="c1">//避免编译器关于未引用参数的警告
</div><div class='line' id='LC216'></span>
</div><div class='line' id='LC217'>									  <span class="c1">// TODO: 在此放置代码。</span>
</div><div class='line' id='LC218'><span class='c1'></span></span>
</div><div class='line' id='LC219'><span class='c1'>									  <span class="c1">// 初始化全局字符串</span>
</div><div class='line' id='LC220'><span class='c1'></span>	<span class="n">LoadStringW</span><span class="p">(</span><span class="n">hInstance</span><span class="p">,</span> <span class="n">IDS_APP_TITLE</span><span class="p">,</span> <span class="n">szTitle</span><span class="p">,</span> <span class="n">MAX_LOADSTRING</span><span class="p">);</span></span>
</div><div class='line' id='LC221'><span class='c1'>	<span class="n">LoadStringW</span><span class="p">(</span><span class="n">hInstance</span><span class="p">,</span> <span class="n">IDC_TETRIS</span><span class="p">,</span> <span class="n">szWindowClass</span><span class="p">,</span> <span class="n">MAX_LOADSTRING</span><span class="p">);</span>
</div><div class='line' id='LC222'>	<span class="n">MyRegisterClass</span><span class="p">(</span><span class="n">hInstance</span><span class="p">);</span><span class="c1">//注册窗口类，用于兼容
</div><div class='line' id='LC223'></span>
</div><div class='line' id='LC224'>							   <span class="c1">// 执行应用程序初始化: </span>
</div><div class='line' id='LC225'><span class='c1'></span>	<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">InitInstance</span><span class="p">(</span><span class="n">hInstance</span><span class="p">,</span> <span class="n">nCmdShow</span><span class="p">))</span></span>
</div><div class='line' id='LC226'><span class='c1'>	<span class="p">{</span>
</div><div class='line' id='LC227'>		<span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
</div><div class='line' id='LC228'>	<span class="p">}</span>
</div><div class='line' id='LC229'>
</div><div class='line' id='LC230'>	<span class="n">HACCEL</span> <span class="n">hAccelTable</span> <span class="o">=</span> <span class="n">LoadAccelerators</span><span class="p">(</span><span class="n">hInstance</span><span class="p">,</span> <span class="n">MAKEINTRESOURCE</span><span class="p">(</span><span class="n">IDC_TETRIS</span><span class="p">));</span><span class="c1">//加载加速器
</div><div class='line' id='LC231'></span>
</div><div class='line' id='LC232'>	<span class="n">MSG</span> <span class="n">msg</span><span class="p">;</span>
</div><div class='line' id='LC233'>
</div><div class='line' id='LC234'>	<span class="c1">// 主消息循环: </span>
</div><div class='line' id='LC235'><span class='c1'></span>	<span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span></span>
</div><div class='line' id='LC236'><span class='c1'>	<span class="p">{</span>
</div><div class='line' id='LC237'>		<span class="k">if</span> <span class="p">(</span><span class="n">PeekMessage</span><span class="p">(</span><span class="o">&amp;</span><span class="n">msg</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">PM_REMOVE</span><span class="p">))</span><span class="c1">//消息检查线程消息队列
</div><div class='line' id='LC238'></span>		<span class="p">{</span>
</div><div class='line' id='LC239'>			<span class="n">TranslateMessage</span><span class="p">(</span><span class="o">&amp;</span><span class="n">msg</span><span class="p">);</span><span class="c1">//将消息的虚拟键转化字符消息
</div><div class='line' id='LC240'></span>			<span class="n">DispatchMessage</span><span class="p">(</span><span class="o">&amp;</span><span class="n">msg</span><span class="p">);</span><span class="c1">//将消息传送到指定窗口函数
</div><div class='line' id='LC241'></span>			<span class="k">if</span> <span class="p">(</span><span class="n">msg</span><span class="p">.</span><span class="n">message</span> <span class="o">==</span> <span class="n">WM_QUIT</span><span class="p">)</span><span class="c1">//若消息是退出，则终止
</div><div class='line' id='LC242'></span>			<span class="p">{</span>
</div><div class='line' id='LC243'>				<span class="k">break</span><span class="p">;</span>
</div><div class='line' id='LC244'>			<span class="p">}</span>
</div><div class='line' id='LC245'>		<span class="p">}</span>
</div><div class='line' id='LC246'>		<span class="k">else</span>
</div><div class='line' id='LC247'>		<span class="p">{</span>
</div><div class='line' id='LC248'>			<span class="k">if</span> <span class="p">((</span><span class="n">GAME_STATE</span> <span class="o">&amp;</span> <span class="mi">2</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span>
</div><div class='line' id='LC249'>			<span class="p">{</span>
</div><div class='line' id='LC250'>				<span class="n">tCur</span> <span class="o">=</span> <span class="n">GetTickCount</span><span class="p">();</span><span class="c1">//返回（retrieve）从操作系统启动所经过（elapsed）的毫秒数
</div><div class='line' id='LC251'></span>				<span class="k">if</span> <span class="p">(</span><span class="n">tCur</span> <span class="o">-</span> <span class="n">tPre</span><span class="o">&gt;</span><span class="n">g_speed</span><span class="p">)</span><span class="c1">//超过反应时间时
</div><div class='line' id='LC252'></span>				<span class="p">{</span>
</div><div class='line' id='LC253'>					<span class="kt">int</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">CheckValide</span><span class="p">(</span><span class="n">curPosX</span><span class="p">,</span> <span class="n">curPosY</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">bCurTeris</span><span class="p">);</span><span class="c1">//判断下一行的情况，返回给flag
</div><div class='line' id='LC254'></span>					<span class="k">if</span> <span class="p">(</span><span class="n">flag</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span><span class="c1">//正常下降一行
</div><div class='line' id='LC255'></span>					<span class="p">{</span>
</div><div class='line' id='LC256'>						<span class="n">curPosY</span><span class="o">++</span><span class="p">;</span><span class="c1">//方块坐标y加1
</div><div class='line' id='LC257'></span>						<span class="n">tPre</span> <span class="o">=</span> <span class="n">tCur</span><span class="p">;</span><span class="c1">//重新计算反应时间
</div><div class='line' id='LC258'></span>						<span class="n">HWND</span> <span class="n">hWnd</span> <span class="o">=</span> <span class="n">GetActiveWindow</span><span class="p">();</span>
</div><div class='line' id='LC259'>						<span class="c1">//这里两次调用实现了双缓冲的作用，改善了视觉效果</span>
</div><div class='line' id='LC260'><span class='c1'></span>						<span class="n">InvalidateRect</span><span class="p">(</span><span class="n">hWnd</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">rc_left</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span><span class="c1">//向指定的窗体更新区域添加一个矩形，然后窗口客户区域的这一部分将被重新绘制</span>
</div><div class='line' id='LC261'><span class='c1'></span>						<span class="n">InvalidateRect</span><span class="p">(</span><span class="n">hWnd</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">rc_right_top</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span><span class="c1">//系统不会像窗口发送WM_PAINT消息，来重绘</span>
</div><div class='line' id='LC262'><span class='c1'></span>					<span class="p">}</span></span>
</div><div class='line' id='LC263'><span class='c1'>					<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">flag</span> <span class="o">==</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="c1">//方块到底时
</div><div class='line' id='LC264'></span>					<span class="p">{</span>
</div><div class='line' id='LC265'>						<span class="n">g_speed</span> <span class="o">=</span> <span class="n">t_speed</span><span class="p">;</span><span class="c1">//重置速度
</div><div class='line' id='LC266'></span>						<span class="n">fillBlock</span><span class="p">();</span><span class="c1">//将方块填充给矩形
</div><div class='line' id='LC267'></span>						<span class="n">checkComplite</span><span class="p">();</span> <span class="c1">//查看能否消去这行
</div><div class='line' id='LC268'></span>						<span class="n">setRandomT</span><span class="p">();</span><span class="c1">//随机产生新的方块
</div><div class='line' id='LC269'></span>						<span class="n">curPosX</span> <span class="o">=</span> <span class="p">(</span><span class="n">NUM_X</span> <span class="o">-</span> <span class="mi">4</span><span class="p">)</span> <span class="o">&gt;&gt;</span> <span class="mi">1</span><span class="p">;</span><span class="c1">//重新设置方块的坐标x
</div><div class='line' id='LC270'></span>						<span class="n">curPosY</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span><span class="c1">//重新设置方块的坐标y
</div><div class='line' id='LC271'></span>						<span class="n">HWND</span> <span class="n">hWnd</span> <span class="o">=</span> <span class="n">GetActiveWindow</span><span class="p">();</span><span class="c1">//获得与调用线程的消息队列相关的活动窗口的窗口句柄
</div><div class='line' id='LC272'></span>						<span class="n">InvalidateRect</span><span class="p">(</span><span class="n">hWnd</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">rc_main</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span><span class="c1">//刷新矩形区域
</div><div class='line' id='LC273'></span>					<span class="p">}</span>
</div><div class='line' id='LC274'>					<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">flag</span> <span class="o">==</span> <span class="o">-</span><span class="mi">3</span><span class="p">)</span><span class="c1">//放不下下一个方块（游戏输了）时
</div><div class='line' id='LC275'></span>					<span class="p">{</span>
</div><div class='line' id='LC276'>						<span class="n">HWND</span> <span class="n">hWnd</span> <span class="o">=</span> <span class="n">GetActiveWindow</span><span class="p">();</span><span class="c1">//获得与调用线程的消息队列相关的活动窗口的窗口句柄
</div><div class='line' id='LC277'></span>						<span class="k">if</span> <span class="p">(</span><span class="n">MessageBox</span><span class="p">(</span><span class="n">hWnd</span><span class="p">,</span> <span class="s">L"胜败乃兵家常事，菜鸡请重新来过"</span><span class="p">,</span> <span class="s">L":时光机"</span><span class="p">,</span> <span class="n">MB_YESNO</span><span class="p">)</span> <span class="o">==</span> <span class="n">IDYES</span><span class="p">)</span><span class="c1">//消息提示，游戏失败
</div><div class='line' id='LC278'></span>						<span class="p">{</span>
</div><div class='line' id='LC279'>							<span class="n">init_game</span><span class="p">();</span><span class="c1">//重新开始游戏
</div><div class='line' id='LC280'></span>						<span class="p">}</span>
</div><div class='line' id='LC281'>						<span class="k">else</span>
</div><div class='line' id='LC282'>						<span class="p">{</span>
</div><div class='line' id='LC283'>							<span class="k">break</span><span class="p">;</span><span class="c1">//退出了消息循环，结束程序
</div><div class='line' id='LC284'></span>						<span class="p">}</span>
</div><div class='line' id='LC285'>					<span class="p">}</span>
</div><div class='line' id='LC286'>				<span class="p">}</span>
</div><div class='line' id='LC287'>			<span class="p">}</span>
</div><div class='line' id='LC288'>		<span class="p">}</span>
</div><div class='line' id='LC289'>	<span class="p">}</span>
</div><div class='line' id='LC290'>
</div><div class='line' id='LC291'>	<span class="k">return</span> <span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="n">msg</span><span class="p">.</span><span class="n">wParam</span><span class="p">;</span>
</div><div class='line' id='LC292'><span class="p">}</span>
</div></pre></div>
</div>
</div>

</div>
</div>
<div class='tree_progress'></div>
<div class='ui small modal' id='modal-linejump'>
<div class='ui custom form content'>
<div class='field'>
<div class='ui right action input'>
<input placeholder='跳转至某一行...' type='number'>
<div class='ui orange button'>
跳转
</div>
</div>
</div>
</div>
</div>

<div class='row column git-project-comments' id='blob-comments'>
<input id="comment_path" name="comment_path" type="hidden" value="message.cpp" />
<input id="reply_comment_id" name="reply_comment_id" type="hidden" />
<div class='git-project-comments'>
<h3 id='project_comm_title'>
<i class='iconfont icon-comment'></i>
评论
(
<span class='comments-count'>
0
</span>
)
</h3>
<div class='ui threaded comments middle aligned' id='notes-list'></div>
<input id="ajax_add_note_id" name="ajax_add_note_id" type="hidden" />
<div class='text-center'>
<div class='tip-loading' style='display: none'>
<div class='ui active mini inline loader'></div>
正在加载...
</div>
</div>
</div>
<script>
  (function() {
    var $btnLoad, $comments, $container, $tipLoading, checkLoad, commentsCount, loadComments, page, path;
  
    page = 0;
  
    commentsCount = 0;
  
    $container = $('.git-project-comments');
  
    $comments = $container.find('.ui.comments');
  
    $tipLoading = $container.find('.tip-loading');
  
    $btnLoad = $container.find('.btn-load-more');
  
    Notes.init();
  
    if (commentsCount < 1) {
      return;
    }
  
    if ($('#comment_path').val() === '') {
      path = '/';
    } else {
      path = $('#comment_path').val();
    }
  
    loadComments = function() {
      $btnLoad.hide();
      $tipLoading.show();
      return $.ajax({
        url: '/B16041616/B16041616LiHaoMing/comment_list',
        data: {
          page: page,
          path: path
        },
        success: function(data) {
          var htmls;
  
          $tipLoading.hide();
          $btnLoad.show();
          if (data.status !== 0) {
            $btnLoad.text('无更多评论');
            return $btnLoad.prop('disabled', true).addClass('disabled');
          } else {
            htmls = data.html.replace(/[\r\n]/g, "");
            $(htmls).each(function(key, html) {
              var depth, note_ids, parentId;
  
              html = $(html).prop("outerHTML");
              if (data.comments_count < 10) {
                note_ids = $('#ajax_add_note_id').val().split(',');
                note_ids.forEach(function(val, index) {
                  if (val === $(html).attr('data-note-id')) {
                    return $('#note_' + val).closest('.children-comments').remove();
                  }
                });
              }
              parentId = $(html).attr('data-parent-id');
              depth = $(html).attr('data-depth');
              if (parentId != null) {
                return $('#note_' + parentId).append("               <div class='children-comments comments' data-deepth='" + depth + "'>                 <a class='toggle toggle-btn comment-show-toggle' href='javascript:void(0)'>                  <i class='iconfont icon-minus-circle'></i></a>" + html + "                  <div class='ui message-text hidden'></div>                </div>               ");
              } else {
                return $comments.append("<div class='comments'>" + html + "</div>");
              }
            });
            $comments.find('.timeago').timeago();
            $comments.find('.commenter-role-label').popup();
            page += 1;
            if (data.comments_count < 10) {
              $('#ajax_add_note_id').val('');
              $btnLoad.text('无更多评论');
              $btnLoad.prop('disabled', true).addClass('disabled');
            }
            noteAnchorLocater.setup();
            return toMathMlCode('', 'comments');
          }
        }
      });
    };
  
    checkLoad = function() {
      var listTop, top;
  
      top = $(window).scrollTop();
      listTop = $container.offset().top;
      if (listTop >= top && listTop < top + $(window).height()) {
        $(window).off('scroll', checkLoad);
        return loadComments();
      }
    };
  
    $btnLoad.on('click', loadComments);
  
    loadComments();
  
    this.noteAnchorLocater.init({
      lastAnchorElm: '#project_comm_title'
    });
  
  }).call(this);
</script>

</div>
<div class='inner-comment-box' id='comment-box'>
<div class='git-project-comment-form' id='project-comment'>
<img avatar="TaoEr233" class="ui avatar image" />
<div class='ui form'>
<div class='field'>
<textarea class='md-input' id='editor_comment' placeholder='在此输入你对项目想说的话...'></textarea>
</div>
<div class='ui field right aligned except-editor-textarea'>
<div class='ui orange button js-comment-button' id='only_comment'>
&emsp;评论&emsp;
</div>
<div class='ui basic button js-close-discussion-note-form' id='comment_cancel_btn'>
&emsp;取消&emsp;
</div>
</div>
</div>
</div>
<script>
  function insertText(obj,str) {
    if (document.selection) {
        var sel = document.selection.createRange();
        sel.text = str;
    } else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
        var startPos = obj.selectionStart,
            endPos = obj.selectionEnd,
            cursorPos = startPos,
            tmpStr = obj.value;
        obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
        cursorPos += str.length;
        obj.selectionStart = obj.selectionEnd = cursorPos;
    } else {
        obj.value += str;
    }
  }
  // 将字符串转义成正则表达式能用的字符串
  function escapeString(str) {
    var out = [];
    var keys = ['\\', '$', '(', ')', '*', '+', '.',
                '[', ']', '?', '^', '{', '}', '|'];
  
    for (var i = 0; i < str.length; ++i) {
      var ch = str.charAt(i);
      if (keys.indexOf(ch) >= 0) {
        out.push('\\');
      }
      out.push(ch);
    }
    return out.join('');
  }
  function editorKeyupHandler() {
    var commit_button = $(this).parent().next().find('.js-comment-button')
    if($.trim($(this).val()).length == 0){
      commit_button.attr('disabled','disabled').addClass('disabled');
    }else{
      commit_button.removeAttr('disabled').removeClass('disabled');
    }
  }
  
  function editorKeydownHandler(e) {
    if( (e.ctrlKey && e.keyCode == 13) || (e.metaKey && e.keyCode == 13) ){
      $(this).parent().next().find('.js-comment-button').trigger('click');
      return false;
    }else if(e.keyCode == 13){
      insertText(document.getElementById("editor_comment"),"  ");
    }
  }
  
  function replyBtnHandler(e) {
    var $input = $(this).parent().prev().find('.md-input');
    var content = $input.val();
    var replyCommentId = $(this).closest('.comment').data('note-id');
    var csrfToken = $('meta[name="csrf-token"]').attr('content');
    var users = $input.data('users');
    var $commentsCount = $('.git-project-comments .comments-count');
    var ref = $('#ref').val();
    var path = $('#comment_path').val();
    if (!jQuery.isEmptyObject(users)) {
      usersData = {}
      Object.keys(users).forEach(function(key) {
        usersData[key] = users[key];
      })
      for(var name in usersData) {
        resetKey(usersData, name, '@' + name);
      }
      Object.keys(usersData).map(function(key) {
        usersData[key] = '@' + usersData[key];
      })
      content = replaceAllName(content, usersData);
    }
    $input.val(content);
    $('.comment_send_loading').show();
    $input.attr("disabled", "disabled");
    $(this).attr("disabled","disabled").addClass("disabled");
  
    $.ajax({
      type: "POST",
      url: "/B16041616/B16041616LiHaoMing/comment",
      data: { authenticity_token: csrfToken, content: content, ref: ref, path: path, reply_comment_id: replyCommentId},
      dataType: "script"
    }).done(function(e){
      $('#note_' + replyCommentId).find('.js-note-reply').first().removeClass('disabled')
      $('#reply_comment_id').val("");
      commentsCount = parseInt($commentsCount.text()) + 1;
      $commentsCount.text(commentsCount);
      insertForm = $('#note_' + replyCommentId).find('.git-project-comment-form')
      insertForm.remove()
    }).always(function(){
      $('.comment_send_loading').hide();
      $input.removeAttr("disabled").val("");
      var comment = $('.comment.note')[0];
      if(comment && !replyCommentId){
        var offsetTop = $(comment).offset().top-80;
        $('body,html').animate({scrollTop:offsetTop},600);
        $(comment).hide().delay(10).fadeIn(1400);
      }
    });
  }
  
  $(function(){
    form = $('.git-project-comment-form');
    form.find("#comment_cancel_btn").hide();
    form.find("#only_comment").attr("disabled","disabled").addClass("disabled", "disabled").click(replyBtnHandler);
    form.find("#editor_comment").on("keyup", editorKeyupHandler).on("keydown", editorKeydownHandler);
  });
</script>

</div>
</div>
</div>
</div>
</div>
<script>
  (function() {
    $(function() {
      return Tree.init();
    });
  
  }).call(this);
</script>

<script>
  Tree.initHighlightTheme('white')
</script>
<script>
  $(function() {
    GitLab.GfmAutoComplete.dataSource = "/B16041616/B16041616LiHaoMing/autocomplete_sources"
    GitLab.GfmAutoComplete.Emoji.assetBase = '/assets/emoji'
    GitLab.GfmAutoComplete.setup();
  });
</script>

<footer id='git-footer-main'>
<div class='ui container'>
<div class='ui two column grid'>
<div class='column'>
<p><a href="https://gitee.com/" target="_blank">© Gitee.com  </a></p>
<div class='ui three column grid' id='footer-left'>
<div class='column'>
<div class='ui link list'>
<div class='item'>
<a href="/terms" class="item">使用条款</a>
</div>
<div class='item'>
<a href="http://git.mydoc.io" class="item">帮助文档</a>
</div>
<div class='item'>
<a href="/api/v5/swagger" class="item">OpenAPI</a>
</div>
</div>
</div>
<div class='column'>
<div class='ui link list'>
<div class='item'>
<a href="https://gitee.com/gitee-stars/" class="item">码云封面人物</a>
</div>
<div class='item'>
<a href="/appclient" class="item">APP与插件下载</a>
</div>
<div class='item'>
<a href="/links.html" class="item">合作伙伴</a>
</div>
</div>
</div>
<div class='column'>
<div class='ui link list'>
<div class='item'>
<a href="https://gitee.com/git-osc/" class="item">更新日志</a>
</div>
<div class='item'>
<a href="/oschina/git-osc/issues/new" class="item">意见与建议</a>
</div>
</div>
</div>
</div>
</div>
<div class='column right aligned followus'>
<div class='qrcode weixin'>
<p class='weixin-text'>微信公众号</p>
<img alt="Qrcode-weixin" src="/assets/qrcode-weixin-8ab7378f5545710bdb3ad5c9d17fedfe.jpg" />
</div>
<div class='phone-and-qq column'>
<div class='ui list'>
<div class='item'>
400-898-2008 转2
</div>
<div class='item' id='git-footer-email'>
git#oschina.cn
</div>
<div class='item qq-and-weibo'>
<a href="//shang.qq.com/wpa/qunwpa?idkey=0d6c2fc0b5b71ac33405dd575bb490bf1a50e3c9a9f694e8a689cb59ee7dacc3" class="icon-popup" title="点击加入码云官方三群"><i class='iconfont icon-logo-qq'></i>
<span>三群：655903986</span>
</a><a href="http://weibo.com/mayunOSC" class="icon-popup" target="_blank" title="关注码云微博"><i class='iconfont icon-logo-weibo'></i>
<span>码云Gitee</span>
</a></div>
</div>
</div>
</div>
</div>
</div>
<div class='bottombar'>
<div class='ui container'>
<div class='ui grid'>
<div class='five wide column partner'>
本站带宽由 <a href="https://www.anchnet.com/" target="_blank" title="anchnet"><img alt="51idc" src="/51idc.png" /></a> 提供
</div>
<div class='eleven wide column right aligned'>
<div class='copyright'>
<a href="http://www.miitbeian.gov.cn/">粤ICP备12009483号-8</a>
深圳市奥思网络科技有限公司版权所有
</div>
<i class='icon world'></i>
<a href="/language/zh-CN">简 体
</a>/
<a href="/language/zh-TW">繁 體
</a>/
<a href="/language/en">English
</a></div>
</div>
</div>
</div>
</footer>
<script>
  function force_mobile() {
    current_url = window.location.href;
    force_mobile_url = current_url.substr(0,current_url.indexOf('?'))+'?force_mobile=true';
    location.href = force_mobile_url;
  }
  (function () {
    // 更新底栏的位置，当页面内容高度小于窗口高度时，会将底栏浮动定位在窗口底端
    function updateFooterPosition() {
      var pageHeight = document.body.offsetHeight;
      if ($footer.hasClass('fixed-bottom')) {
        pageHeight += $footer.outerHeight();
        if (pageHeight > $(window).height()) {
          $footer.removeClass('fixed-bottom');
        }
      } else {
        if (pageHeight < $(window).height()) {
          $footer.addClass('fixed-bottom');
        }
      }
    }
    var $footer = $('#git-footer-main');
    $(document).on('ready', updateFooterPosition);
    $(window).on({
      'scroll': updateFooterPosition,
      'resize': updateFooterPosition
    });
    // 每隔一段时间检测页面高度变化，确保底栏能在页面最底端
    setInterval(updateFooterPosition, 500);
    var email = $('#git-footer-email').text();
    $('#git-footer-email').text(email.replace('#', '@'));
  })();
  $('.icon-popup').popup({ position: 'bottom center' });
</script>
<div class='side-toolbar'>
<div class='button share-link'>
<i class='iconfont icon-share'></i>
</div>
<div class='ui popup'>
<div class='header'>
分享到
</div>
<div class='bdsharebuttonbox'>
<a class='item bds_weixin' data-cmd='weixin' title='分享到微信'>weixin</a>
<a class='item bds_tsina' data-cmd='tsina' title='分享到新浪微博'>sina</a>
<a class='item bds_sqq' data-cmd='sqq' title='分享到QQ好友'>qq</a>
<a class='item bds_qzone' data-cmd='qzone' title='分享到QQ空间'>qzone</a>
</div>
</div>
<div class='popup button' data-content='给项目拥有者发送私信' id='project-user-message'>
<i class='iconfont icon-message'></i>
</div>
<div class='popup button' data-content='评论' id='home-comment'>
<i class='iconfont icon-comment'></i>
</div>
<div class='button gotop popup' data-content='回到顶部' id='gotop'>
<i class='iconfont icon-top'></i>
</div>
</div>
<div class='ui modal message-input'>
<i class='close icon'></i>
<div class='header'>给用户发送私信</div>
<div class='content'>
<textarea class='message-content' maxlength='250' placeholder='请在这里输入私信内容' style='padding:1em;width:100%;resize:none;'></textarea>
</div>
<div class='actions'>
<div class='ui orange right labeled icon button ok' id='send-message'>
发送
<i class='checkmark icon'></i>
</div>
<div class='ui button basic cancel'>
取消
</div>
</div>
</div>
<script>
  (function() {
    var sendMessage;
  
    $('#project-user-message').popup({
      position: 'left center'
    });
  
    $('body').delegate('#project-user-message, #show_send_msg_btn', 'click', function() {
      $('.message-content').val('');
      return $('.message-input').modal({
        onApprove: function() {
          return sendMessage("");
        }
      }).modal('show');
    });
  
    $('body').delegate('.set-msg-content', 'click', function() {
      return $('.message-content').val('想请您喝杯咖啡，请您开启项目捐赠功能吧。');
    });
  
    $('.message-content').on('keydown', function(e) {
      if ((e.ctrlKey && e.keyCode === 13) || (e.metaKey && e.keyCode === 13)) {
        $('#send-message').trigger('click');
        return false;
      }
    });
  
    sendMessage = function(e) {
      var content, username;
  
      content = $('.message-content').val();
      if ($.trim(content).length === 0) {
        alert("请输入私信内容");
        return false;
      } else {
        username = gon.message;
        return $.ajax({
          url: "/" + username + "/message",
          beforeSend: function(xhr) {
            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
          },
          type: 'POST',
          data: {
            content: content
          },
          success: function(data) {
            if (data.status === 0) {
              return alert("可能由于发送过于频繁，留言发送失败，请稍后再试");
            } else {
              $('#project-ok-msg').fadeIn();
              return setTimeout(function() {
                return $('#project-ok-msg').fadeOut('2500');
              }, 1500);
            }
          },
          error: function() {
            return alert("可能由于网络原因，留言发送失败，请稍后再试");
          }
        });
      }
    };
  
  }).call(this);
</script>
<script>
  (function() {
    var $gotop, $root, $toolbar, update;
  
    $root = $('body, html');
  
    $toolbar = $('.side-toolbar');
  
    $gotop = $('#gotop').popup({
      position: 'left center'
    }).on('click', function() {
      return $root.animate({
        scrollTop: 0
      }, 500);
    });
  
    update = function() {
      if ($(window).scrollTop() > 50) {
        return $gotop.addClass('active');
      } else {
        return $gotop.removeClass('active');
      }
    };
  
    $(window).on('scroll', update);
  
    update();
  
    $toolbar.find('.share-link').popup({
      inline: true,
      hoverable: true,
      position: 'left center',
      delay: {
        hide: 500
      }
    });
  
  }).call(this);
</script>
<script>
  (function() {
    var $comment, $root;
  
    $root = $('body, html');
  
    $comment = $('#home-comment').popup({
      position: 'left center'
    });
  
    $comment.on('click', function() {
      var comment, href, offsetTop;
  
      if ($('#project_comm_title').length === 0) {
        href = '/B16041616/B16041616LiHaoMing#project_comm_title';
        window.location.href = href;
        return;
      }
      comment = $('.comment.note')[0];
      if (comment) {
        offsetTop = $(comment).offset().top - 80;
        return $root.animate({
          scrollTop: offsetTop
        }, 400);
      } else {
        offsetTop = $('#editor_comment').offset().top + 30;
        $root.animate({
          scrollTop: offsetTop
        }, 400);
        return $('#editor_comment').focus();
      }
    });
  
  }).call(this);
</script>
<script>
  window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"分享到新浪微博","bdMini":"1","bdMiniList":["bdxc","tqf","douban","bdhome","sqq","thx","ibaidu","meilishuo","mogujie","diandian","huaban","duitang","hx","fx","youdao","sdo","qingbiji","people","xinhua","mail","isohu","yaolan","wealink","ty","iguba","fbook","twi","linkedin","h163","evernotecn","copy","print"],"bdPic":"","bdStyle":"1","bdSize":"32"},"share":{}};
</script>
<script src="/bd_share/static/api/js/share.js" type="text/javascript"></script>



<script>
  (function() {
    this.__gac = {
      domain: 'www.oschina.net'
    };
  
  }).call(this);
</script>
<script defer src='//www.oschina.net/public/javascripts/cjl/ga.js?t=20160926' type='text/javascript'></script>

</body>
</html>
